rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Ability to suppress adding post data to query string when building request URI #228

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?
NONE

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?
ALL

Please describe the feature requested.
Presently, all of the URL's model data with @Key annotation is serialized onto 
the URL's query string, even when the request method is POST. For POST 
requests, the model data is typically serialized programmatically using an 
HttpContent implementation and a corresponding factory. However, the 
HttpRequest also tries to serialize the model data and include it on the query 
string for POST requests. The serialization result ends up with fully qualified 
class names in the parameter values and is makes the request larger than need 
be.

Expose a way to control whether model data is to be serialized to the query 
string. I recommend that by default, model data is not serialized and to the 
query string for POST requests. This would require exposing a new method on 
GenericUrl that can be invoked by HttpRequest when executing a POST request.

Here's the stack trace that results in the current behavior (from Version 
1.15.0-rc):

com.google.api.client.http.GenericUrl.buildRelativeUrl():380
com.google.api.client.http.GenericUrl.build():334
com.google.api.client.http.HttpRequest.build():857

Original issue reported on code.google.com by southern...@gmail.com on 29 May 2013 at 7:51