|
-
Jun 19th, 2017, 02:32 PM
#10
Thread Starter
Member
Re: Help using JSON API that requires Authentication with JWT token
Oh,
When you said BOM I thought you were just saying the command would bomb! I didn't know it was an acronym! Thanks for explaining it to me.
Jim
 Originally Posted by Inferrd
Because 'System.Text.Encoding.UTF8' is a version of the UTF-8 encoding that happens to emit a BOM (Byte Order Mark) when used with a StreamWriter.
For UTf-8, the BOM consists of three bytes with the values 0xEF, 0xBB, 0xBF. These bytes are prepended to the output, so they would be sent as part of the POST data before the actual JSON text, and the tvdb server considers that to be bad JSON.
Remember, as I mentioned in the earlier post, you can create an instance of the UTF-8 encoding that does not emit a BOM, and that's done by default when you don't specify an encoding when you create the StreamWriter.
Take a look at the following links for more info:
https://en.wikipedia.org/wiki/Byte_order_mark
https://stackoverflow.com/questions/...-8-without-bom
Edit: I see I was too slow 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|