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

Raw Data #10

Closed
cboden opened this issue Jan 7, 2012 · 2 comments
Closed

Raw Data #10

cboden opened this issue Jan 7, 2012 · 2 comments

Comments

@cboden
Copy link
Contributor

cboden commented Jan 7, 2012

Feature request: When making a request with the Guzzle\Http\Request object I need the ability to set/get a raw body/query (as a string). Currently (if I understand correctly) it must be a Guzzle\Common\Collection object with key/val pairing.

This is needed (for example) when making a request to many Google APIs. Currently I'm (without Guzzle, want to switch) doing a cURL request setting CURLOPT_POSTFIELDS to a raw json string.

@mtdowling
Copy link
Member

Hi Chris,

Are you trying to set a raw body for a put or post request? If so, you can use the setBody() method of an EntityEnclosingRequest object (which is automatically created when calling out or post on a Client object).

-Michael

On Jan 6, 2012, at 11:00 PM, Chris Bodenreply@reply.github.com wrote:

Feature request: When making a request with the Guzzle\Http\Request object I need the ability to set/get a raw body/query (as a string). Currently (if I understand correctly) it must be a Guzzle\Common\Collection object with key/val pairing.

This is needed (for example) when making a request to many Google APIs. Currently I'm (without Guzzle, want to switch) doing a cURL request setting CURLOPT_POSTFIELDS to a raw json string.


Reply to this email directly or view it on GitHub:
#10

@cboden
Copy link
Contributor Author

cboden commented Jan 7, 2012

I see. I was using RequestFactory::fromMessage() and receiving a Request object (method was GET).

Showing me the EntityEnclosingRequest object helped me better understand how Guzzle works...I need an EntityEnclosingRequest object from a message string that uses GET. To accomplish this I will extend RequestFactory in my own library and create a method to do this.

I realize what I'm trying to do is a total fringe case. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants