Specify "application/json" content-type for POST/PUT requests#8
Merged
Conversation
For certain POST and PUT requests, this specifies the content type as "application/json" (instead of the oauth module's default "application/x-www-form-urlencoded"). This seems to fix "signature invalid" errors.
1 similar comment
This was referenced Feb 20, 2017
|
@d33psky, thank you for merge. Can you update NPM package also? Thank you in advance. |
Contributor
Author
|
@d33psky bump! for release attention |
Contributor
Author
|
@peter-rybar, in the meantime, you can set the value of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For certain POST and PUT requests, this specifies the content type as "application/json" (instead of the oauth module's default "application/x-www-form-urlencoded"). This seems to fix "signature invalid" errors.
Around the start of September, requests to Shapeways were failing because of "invalid signature" errors, this commit seems to fix those issues.
Note: this was only tested for the
addModelmethod (as it's the only one I'm using), but it should apply to all requests that hadJSON.stringifycalled on a javascript object and passed as thebodyargument.Closes #7
This was made possible using the suggestions made by @imdaveho and @RandomCouch. Thanks you two!