Skip to content

add multipart parameter to request#214

Merged
mamantoha merged 1 commit intomamantoha:masterfrom
jphaward:add-multipart-parameter-to-request
Jul 25, 2023
Merged

add multipart parameter to request#214
mamantoha merged 1 commit intomamantoha:masterfrom
jphaward:add-multipart-parameter-to-request

Conversation

@jphaward
Copy link

There is currently no option of sending a POST request to an API that is expecting a content-type of 'multipart/form-data' without a file. Some APIs will still expect this content-type but the file itself will be optional so does not always need to be sent.

This pull requests adds an optional parameter of 'multipart' which is used in the form_class conditional to select the Crest::DataForm form. The json parameter has higher precedence to the multipart parameter if both are given with the default still being URLencodedform.

@mamantoha
Copy link
Owner

@jphaward Thank you for your contribution 🙏 . It looks good to me.

@mamantoha mamantoha merged commit 146ed2c into mamantoha:master Jul 25, 2023
@mamantoha
Copy link
Owner

@all-contributors please add @jphaward for code

@allcontributors
Copy link
Contributor

@mamantoha

I've put up a pull request to add @jphaward! 🎉

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

Successfully merging this pull request may close these issues.

2 participants