Hi,
If I use Sockets to post the JSON(instead of HTTP Post), how will I
retrieve the JSON and status code in the server?
Also with HTTP Post, I want to retreive both(the status code and JSON). Can
you please suggest an example?
Thanks!
On Wednesday, October 24, 2012 3:29:16 PM UTC+3, skink
Archana wrote:
Hi,
If I use Sockets to post the JSON(instead of HTTP Post), how will I
retrieve the JSON and status code in the server?
Also with HTTP Post, I want to retreive both(the status code and JSON). Can
you please suggest an example?
Thanks!
what status code? a status code is
Hi,
So should I set the status code using Apache Core like
HttpResponse response = new
BasicHttpResponse(HttpVersion.HTTP_1_1, 200, OK);
response.setEntity(new StringEntity(Got it));
conn.sendResponseHeader(response);
conn.sendResponseEntity(response);
in
Archana wrote:
Hi,
So should I set the status code using Apache Core like
HttpResponse response = new
BasicHttpResponse(HttpVersion.HTTP_1_1, 200, OK);
response.setEntity(new StringEntity(Got it));
conn.sendResponseHeader(response);
Yes it seems to work! I will get real devices next week. Later, I will
test on those.
On Tuesday, October 23, 2012 9:44:57 PM UTC+3, Archana wrote:
Hi, I did a HTTP Post from client. In server, I am able to see like,
POST /HTTP/ 1.1
Content Length: 41
Content-type: application/json
Hi, when I use that,
StringWriter writer = new
StringWriter();
IOUtils.copy(socket.getInputStream(),writer,HTTP.UTF_8);
String string = writer.toString();
Log.d(Writer value is : ,writer.toString());
Nothing is getting printed in console. Can you provide
Archana wrote:
Hi, when I use that,
StringWriter writer = new
StringWriter();
IOUtils.copy(socket.getInputStream(),writer,HTTP.UTF_8);
String string = writer.toString();
Log.d(Writer value is : ,writer.toString());
Nothing is getting printed in
Actually when I print using
InputStreamReader isr = new
InputStreamReader(socket.getInputStream(),utf-8);
BufferedReader br = new BufferedReader(isr);
int b;
StringBuilder buf = new StringBuilder();
Log.d(Before while,whil);
while ((b = br.read()) != -1) {
Archana wrote:
Actually when I print using
InputStreamReader isr = new
InputStreamReader(socket.getInputStream(),utf-8);
BufferedReader br = new BufferedReader(isr);
int b;
StringBuilder buf = new StringBuilder();
Log.d(Before while,whil);
while ((b =
Hi, my problem is similar
to
stackoverflow.com/questions/13046872/receiving-data-from-http-post-using-sockets
Can someone help me?
On Wednesday, October 24, 2012 9:57:33 AM UTC+3, skink wrote:
Archana wrote:
Actually when I print using
InputStreamReader isr =
Archana wrote:
Hi, my problem is similar
to
stackoverflow.com/questions/13046872/receiving-data-from-http-post-using-sockets
Can someone help me?
if you learned how to efficiently use google instead of asking people
each time you have any problem you would find this:
Thank you for your support! As I am still a learner(with just 3 months
working in Android), I have some problems.
On Wednesday, October 24, 2012 3:29:16 PM UTC+3, skink wrote:
Archana wrote:
Hi, my problem is similar
to
Archana wrote:
Hi, I did a HTTP Post from client. In server, I am able to see like,
POST /HTTP/ 1.1
Content Length: 41
Content-type: application/json
Host:10.0.2.15:5001
Connection: Keep Alive
How do I retrieve the content of JSON using socket.getInputStream()?
Any example/help is
13 matches
Mail list logo