05/08/20 02:11:45
public void doHttp() {
byte[] buf = null;
HttpConnection http = null;
OutputStream out = null;
InputStream in = null;
ByteArrayOutputStream baos = null;
String resMsg;
in resCode
try {
http = (HttpConnection)Connector.open( "URLリンク(xxxxxxxx)" ); // 自宅サーバURL
http.setRequestMethod( HttpConnection.POST ); // GET HEADでも確認
long time = http.getDate() ;
in = http.openInputStream();
resCode = http.getResponseCode();
int contentLength = (int)http.getLength();
buf = new byte[1024];
baos = new ByteArrayOutputStream();
int len = 0;
while ( ( len = in.read( buf ) ) != -1 ) {
baos.write( buf, 0, len );
}
baos.close();
buf = null;