The input is not a valid Base-64 string as it contains a non-base64 character

后端 未结 11 1725
难免孤独
难免孤独 2020-11-27 14:37

I have a REST service that reads a file and sends it to another console application after converting it to Byte array and then to Base64 string. This part works, but when th

11条回答
  •  抹茶落季
    2020-11-27 15:19

    Since you're returning a string as JSON, that string will include the opening and closing quotes in the raw response. So your response should probably look like:

    "abc123XYZ=="
    

    or whatever...You can try confirming this with Fiddler.

    My guess is that the result.Content is the raw string, including the quotes. If that's the case, then result.Content will need to be deserialized before you can use it.

提交回复
热议问题