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

Make the ApiClient use application/x-www-form-urlencoded as content type #399

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

supherman
Copy link
Contributor

Summary

One of the issues I encountered after upgrading to V2 is that all of the tests that were stubbing requests to twilio failed, turns out Webmock does not support matching the request body for multipart/form-data requests, the error thrown was this:

ArgumentError: WebMock does not support matching body for multipart/form-data requests yet :(

I believe multipart/form-data is mostly used for file uploads, so, perhaps using application/x-www-form-urlencoded makes more sense to submit plain form data.

Testing

All Tests are passing, added body matching to the Twilio request stub.

Checklist

  • Code follows the project's coding standards
  • Tests have been added or updated to cover the changes
  • Documentation has been updated (if applicable)
  • All existing tests pass
  • Conforms to the contributing guidelines

@supherman supherman changed the title Make the ApiClient use application/x-www-form-urlencoded as content t… Make the ApiClient use application/x-www-form-urlencoded as content type Feb 9, 2024
@excid3
Copy link
Owner

excid3 commented Feb 9, 2024

I think this is what I intended originally but wasn't paying close attention to it.

Chances are you won't be uploading files in notifications and you can always implement your own POST request if you did want to, so this makes sense to me to update.

@excid3 excid3 merged commit 67411c7 into excid3:main Feb 9, 2024
45 checks passed
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