The input is not a valid Base-64 string Error, My JSON uses double quotation marks instead of single quotations

我与影子孤独终老i 提交于 2019-12-25 03:18:57

问题


I am trying to send a JSON post, but my JSON seems to differ a little bit from what the site usually sends
Here is what i am sending:

{"CodeNumberTextBox":"","txusername":"yC6IBEbznlRlKOKv8zrhiA","txpass":"pAQAyrr5u9/hK35iTIlt7Q=="}

Here is what the website sends when you click login:

{ CodeNumberTextBox:'', txusername:'yC6IBEbznlRlKOKv8zrhiA', txpass:'pAQAyrr5u9/hK35iTIlt7Q==' }

Here is the error i get when i send my JSON:
'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. '
I use the code below to create my JSON:

  jsonRawRequest := TJSONObject.Create;
  jsonObject.AddPair('CodeNumberTextBox', '');
  jsonObject.AddPair('txusername', 'yC6IBEbznlRlKOKv8zrhiA');
  jsonObject.AddPair('txpass', 'pAQAyrr5u9/hK35iTIlt7Q==');
  jsonRequest := TStringStream.Create(jsonRawRequest.ToString(), TEncoding.UTF8);

  idHttp.Request.ContentType := 'application/json';
  idHttp.Request.Referer := 'SomeURL';
  idHttp.Post(URL, jsonRequest, ms)

来源:https://stackoverflow.com/questions/53851315/the-input-is-not-a-valid-base-64-string-error-my-json-uses-double-quotation-mar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!