これは簡単かもしれませんが、私は混乱しています。
Android Restlet を使用してサーバー上で HTTP POST を実行しようとしており、サーバーから返された応答を読み取ろうとしています。
私は以下を使用してフォームを作成しました:
Form form = new Form
form.add("msg" ,"This is my message");
今、私は次のように clientResource を持っています:
ClientResource clientResource = new ClientResource("www.example.com/my-http-post-url/");
今、私は HTTP Post を次のようにやっています:
Representation response=null;
try{
response= clientResource.post(form.getWebRepresentation(null));
System.out.println("Got response !! , response : " + response.getText());
System.out.println( "Got Context: " + clientResource.getContext() );
System.out.println( "Got Response: " + clientResource.getResponse());
System.out.println( "Got Resonse Attribute : " + clientResource.getResponseAttributes() );
System.out.println( "Got Resonse Entity: " + clientResource.getResponseEntity() );
}catch(Exception e){
e.printStackTrace();
}
コードが try 内にあることがわかりましたが、その印刷は次のとおりです。
I/org.restlet( 493): Starting the default HTTP client
I/System.out( 493): Got response !! , response : null
I/System.out( 493): Got Context: null
I/System.out( 493): Got Response: HTTP/1.1 - OK (200) - OK
I/System.out( 493): Got Resonse Attribute : {org.restlet.http.headers=[(Date,Sun, 22 Jul 2012 22:14:03 GMT), (Server,WSGIServer/0.1 Python/2.7.1+), (Vary,Authorization), (Content-Type,application/json; charset=utf-8)]}
I/System.out( 493): Got Resonse Entity: [application/json,UTF-8]
サーバーが応答しているかどうかを確認するためにデータを盗聴してみましたが、サーバーが応答コンテンツを送信していると確信しています。
サーバーから送信された応答コンテンツを見つけるにはどうすればよいですか?