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 request body data #160

Open
timwhitlock opened this issue Mar 19, 2018 · 3 comments
Open

Raw request body data #160

timwhitlock opened this issue Mar 19, 2018 · 3 comments

Comments

@timwhitlock
Copy link

Hi.

I notice that the BodyLocation for "body" parameters adds the name of the bound parameter to the request body. e.g. [ 'raw' => 'data' ] gets posted as an 8 byte string in the request: raw=data.

Is this deliberate? I assumed that value pairs would be handled by FormParamLocation and that the "body" location would be for raw/binary data.

I'm looking to post data as the body as if I had used --data-binary from command line cURL. For example:

> POST /something.txt HTTP/1.1
> Content-Type: text/plain
> Content-Length: 18
> 
> This is plain text

Looking at the Serializer it seems I can do this for xml and json locations, but not arbitrary data.

Thanks in advance for clarification on this.

@timwhitlock
Copy link
Author

timwhitlock commented Apr 16, 2018

If anyone's interested, I got around this problem with my own BodyLocation class.

This can be set by overriding the request serializer and passing it thus.

@yaozongyou
Copy link

If anyone's interested, I got around this problem with my own BodyLocation class.

This can be set by overriding the request serializer and passing it thus.

this is of great help~, thanks.

@yaozongyou
Copy link

The same question occurs to me, is this will be fixed?

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