Android の AsyncTask からサーバーに HTTP ポスト リクエスト ポスト リクエストを送信しています。
応答を管理する際に私が直面している問題。ここで私は応答をどのように読んだか。
HttpEntity entity =response.getEntity();
if (entity != null) {
DataInputStream in = new DataInputStream( entity.getContent());
String str;
while (( str = in.readLine()) != null){
Log.e("Debug","Server Response second url"+str);
}
in.close();
}
問題は、私は応答をバラバラに受け取っていることですが、私はそれらをワンピースにしたかったのです
現在の応答
Server Response second url
Server Response second url<header><status>Success</status><message>Check the Numbers:
Server Response second url123456.</message><vbal>5005</vbal></header>
期待される反応
<header><status>Success</status><message>Check the Numbers:123456.</message><vbal>5005</vbal></header>
ワンピースで取得する場合は、xml 応答を簡単に解析して、必要な値を取得できます。