Skip to content

Use with SP-API #578

Answered by pedrogabe
pedrogabe asked this question in Q&A
Jul 7, 2022 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

I have reached a solution for this problem by myself.
According to Amazon SP-API documentation a "User-Agent" header is required, and its value should comply with the following format:
AppId/AppVersionId (Language=LanguageNameAndOptionallyVersion)
I tried to add this header as a default request header of my HttpClient with a code line similar to this:
client.DefaultRequestHeaders.Add(Amazon.Util.HeaderKeys.UserAgentHeader, "App/0.0 (Language=Csharp)");

Yet, this Add method converted my string into two different values splitting it by the space character. Hence, the CanonicalRequest class included a comma in the canonical string that Amazon was not expecting.
I temporarily solved it by mod…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@FantasticFiasco
Comment options

@pedrogabe
Comment options

@mungojam
Comment options

Answer selected by pedrogabe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants