hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Michael.Fankanow...@t-systems.com>
Subject java.lang.NullPointerException at org.apache.http.entity.StringEntity.<init>(StringEntity.java:70
Date Fri, 25 May 2012 12:52:07 GMT
Hi all,

I receive a NullPointerException when I'm doing this:

HttpPost method = new HttpPost(someUri);
ContentType ct = ContentType.create("text/xml");
StringEntity entity = new StringEntity(someString, ct);
method.setEntity(entity);

The javadoc says that parameter charset is optional for ContentType but it seems not for StringEntity.
I have the requirement to send a http post with content-type: text/xml in the http header
but without a charset. Do I create the HttpPost in a wrong manner or does the requirement
make no sense or is it a bug?

Kind regards,

Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message