Skip to content

Specify "application/json" content-type for POST/PUT requests#8

Merged
d33psky merged 3 commits into
Shapeways:masterfrom
dhritzkiv:patch-2
Feb 20, 2017
Merged

Specify "application/json" content-type for POST/PUT requests#8
d33psky merged 3 commits into
Shapeways:masterfrom
dhritzkiv:patch-2

Conversation

@dhritzkiv
Copy link
Copy Markdown
Contributor

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 addModel method (as it's the only one I'm using), but it should apply to all requests that had JSON.stringify called on a javascript object and passed as the body argument.


Closes #7

This was made possible using the suggestions made by @imdaveho and @RandomCouch. Thanks you two!

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.
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 7, 2016

Coverage Status

Coverage decreased (-3.3%) to 93.258% when pulling 2213d18 on dhritzkiv:patch-2 into 5116d3f on Shapeways:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-3.3%) to 93.258% when pulling 2213d18 on dhritzkiv:patch-2 into 5116d3f on Shapeways:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 7, 2016

Coverage Status

Coverage decreased (-3.3%) to 93.258% when pulling 0874632 on dhritzkiv:patch-2 into 5116d3f on Shapeways:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 7, 2016

Coverage Status

Coverage increased (+0.1%) to 96.629% when pulling 18b8682 on dhritzkiv:patch-2 into 5116d3f on Shapeways:master.

Copy link
Copy Markdown
Contributor

@d33psky d33psky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. thanks.

@d33psky d33psky merged commit 9d0a5a4 into Shapeways:master Feb 20, 2017
@peter-rybar
Copy link
Copy Markdown

@d33psky, thank you for merge. Can you update NPM package also? Thank you in advance.

@dhritzkiv
Copy link
Copy Markdown
Contributor Author

@d33psky bump! for release attention

@dhritzkiv
Copy link
Copy Markdown
Contributor Author

@peter-rybar, in the meantime, you can set the value of "shapeways" in your package.json to "git+ssh://git@github.com:Shapeways/node-shapeways.git#9d0a5a4e90dda958061a0973357700eb28b5ce79" to target the repo's current state

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.

Signature Invalid on POST requests

4 participants