I am getting an "OK" status,but no XML content in the response.
Using HttpClient API for Java.
HttpPost post= new HttpPost("
https://MYLOGIN.freshbooks.com/api/2.1/
xml-in");
System.out.println(post.getRequestLine());
StringEntity se = new StringEntity("<request method=\"system.current
\"></request>","UTF-8");
se.setContentType("text/xml");
post.setHeader("Content-Type","application/x-www-form-urlencoded");
post.setEntity(se);
HttpResponse response = httpclient.execute(post);
System.out.println(response.getProtocolVersion());
System.out.println(response.getStatusLine().getStatusCode());
System.out.println(response.getStatusLine().toString());
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
System.out.println(instream.toString());
}
}
Output in console:
HTTP/1.1 200 OK
org.apache.http.conn.EofSensorInputStream@17e845a
Please,somebody tell me what I am missing. :(