我正在尝试发送JSON
帖子,但我的JSON
似乎与网站通常发送的帖子有所不同
这是我要发送的内容:
{"CodeNumberTextBox":"","txusername":"yC6IBEbznlRlKOKv8zrhiA","txpass":"pAQAyrr5u9/hK35iTIlt7Q=="}
这是您单击登录后网站发送的内容:
{ CodeNumberTextBox:'', txusername:'yC6IBEbznlRlKOKv8zrhiA', txpass:'pAQAyrr5u9/hK35iTIlt7Q==' }
这是我发送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. '
我使用下面的代码创建我的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)