Closed bent0b0x closed 5 years ago
@trss to be upfront, I have not been able to fully test this code 😓. I no longer have an amazon seller account, so I do not have a way to end-to-end test w/ the MWS BE. However, I'm going to merge this and then ship a beta
npm package release that you can install and test locally 🙏
I copied the algorithm from amazon's own MWS scratchpad: https://mws.amazonservices.com/scratchpad/index.html
Very neat! I was able to find it too commented as: Performs URL encoding compatible with MWS http requests
Nevertheless, sharing a few SO Q&A I found useful in the context of this fix:
Issue
7
Context The uri encoding being performed by this library is not entirely compatible with the MWS back-end. Specifically, characters like
"!"
and"'"
are not encoded byencodeURIComponent
, but MWS requires them to be.Work Done Encode all characters required by MWS back-end when constructing request url.
Notes This encoding should be fully compatible now. I copied the algorithm from amazon's own MWS scratchpad: https://mws.amazonservices.com/scratchpad/index.html
cc @trss