/* URLEncodedUtils won't parse the content unless the content-type is
application/x-www-form-urlencoded. Since we want to be able to force
parsing regardless of what the content-type header says, we need to
'spoof' the content-type if it's not already acceptable. */
if ( ! ContentType.URLENC.toString().equals( ParserRegistry.getContentType( resp ) ) ) {
entity = new HttpEntityWrapper( entity ) {
@Override public org.apache.http.Header getContentType() {
String value = ContentType.URLENC.toString();
String charset = ParserRegistry.getCharset( resp );
if ( charset != null ) value += "; charset=" + charset;
return new BasicHeader( "Content-Type", value );