Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestContentType is added as a argument to encode method #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/main/java/groovyx/net/http/EncoderRegistry.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ else if ( data instanceof Reader && ! (data instanceof BufferedReader) )
* @return an {@link HttpEntity} encapsulating this request data
* @throws UnsupportedEncodingException
*/
public UrlEncodedFormEntity encodeForm( Map<?,?> params )
throws UnsupportedEncodingException {
return encodeForm( params, null );
}

public UrlEncodedFormEntity encodeForm( Map<?,?> params, Object contentType )
throws UnsupportedEncodingException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/groovyx/net/http/HttpURLClient.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public HttpResponseDecorator request( Map<String,?> args )
if ( arg != null ) { // if there is a request POST or PUT body
conn.setDoOutput( true );
final HttpEntity body = (HttpEntity)encoderRegistry.getAt(
requestContentType ).call( arg );
requestContentType ).call( arg, requestContentType );
// TODO configurable request charset

//TODO don't override if there is a 'content-type' in the headers list
Expand Down