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

ClassCastException in ApacheHttpRequest.setContent #122

Closed
wonderfly opened this issue Jan 9, 2015 · 2 comments
Closed

ClassCastException in ApacheHttpRequest.setContent #122

wonderfly opened this issue Jan 9, 2015 · 2 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@wonderfly
Copy link
Contributor

From yan...@google.com on May 29, 2012 11:20:49

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.9.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Android 2.2 (Froyo) Describe the problem. See: https://groups.google.com/forum/?fromgroups#!topic/google-http-java-client/32ZFWeaAyVM stack trace copied here:

05-23 13:15:00.526: W/System.err(1168): java.lang.ClassCastException: org.apache.http.client.methods.HttpGet
05-23 13:15:00.537: W/System.err(1168): at com.google.api.client.http.apache.ApacheHttpRequest.setContent(ApacheHttpRequest.java:66)
05-23 13:15:00.537: W/System.err(1168): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:805) How would you expect it to be fixed? It is very rare to see an HTTP GET request with content. It is not strictly forbidden though, see: http://tech.groups.yahoo.com/group/rest-discuss/message/9962 Problem is that the Apache HTTP Client just doesn't support that use case. So at least we should throw a nice IllegalArgumentException with an explanation instead of a ClassCastException.

A nicer option is that we could actually work around the limitation like we've done with HttpPatch. It should be easy enough to implement, but given how rare it is, it might not be important enough to fix.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=122

@wonderfly wonderfly added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. imported priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From rmis...@google.com on August 15, 2012 05:28:49

http://codereview.appspot.com/6450137/

Status: Started

@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From rmis...@google.com on August 22, 2012 13:40:30

Status: Fixed

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
use metadata server to get credentials for GAE 8 standard environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants