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

Support for content-type in each of multi-part rquest #222

Closed
wants to merge 4 commits into from

Conversation

nishantrayan
Copy link

This allows users to specify content-type in payload like,
RestClient.post(url, {data: "something", content_type: "text/plain"})

Some Rest servers check for content type in each part before taking doing anything with the data in part.
This option will only be honored with multipart option enabled.

@aliaksandr-trush
Copy link

+1 for this enhancement

@ab ab added the need tests label Mar 28, 2014
@jlambert121
Copy link

I ran into this today - I have a submit I needed to do with two parts, each with a different content type. The way I read this, it appears to only allow setting the content-type if there is a single part, is that correct?

Aliaksandr Trush and others added 2 commits October 8, 2014 13:56
@nishantrayan
Copy link
Author

Merged the test cases. It can be merged to the main repo.

@aliaksandr-trush
Copy link

Hello, @ab can you merge the pull request?

@abotalov
Copy link

abotalov commented Dec 1, 2016

Currently params argument is a hash where keys are part names and values are bodies of these parts.
This pull request makes :content_type key being treated specially so it will represent not a part name but Content-Type that has to be applied to all regular parts. In particular, it doesn't allow different parts to have different Content-Types.
IMO it's not a good design decision. Also it's not quiet backwards compatible.

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

Successfully merging this pull request may close these issues.

None yet

5 participants