RequestBody:=TstringStream.Create('');
RequestBody.WriteString(
'{'+
'"telNumber": '+'"+998998970597"'+','+
'"userType": '+'3'+','+
'"smsCode": '+'1234'+
'}'
);
mmo2.Lines.Add(RequestBody.DataString) ;
httpsend.Headers.Add('Accept: */*');
httpsend.headers.add('Content-Type: application/json');
httpsend.Headers.Add('langId: 3');
ShowMessage(link);
httpsend.MimeType:='application/json';
httpsend.Timeout:=1000;
httpsend.UserAgent:='Farcards';
httpsend.Document.LoadFromStream(RequestBody);
if httpsend.HTTPMethod('POST',link) then
begin
stream_in:=TStringStream.Create('');
httpsend.Document.SaveToStream(stream_in);
mmo1.Lines.add(stream_in.datastring);
// jsonAnswer:=so(stream_in.datastring) //парсим json в superObject
end
else begin
ShowMessage('Exception');
ShowMessage(IntToStr(httpsend.ResultCode));
// stream_in:=TStringStream.Create('');
// httpsend.Document.SaveToStream(stream_in);
// mmo1.Lines.add(stream_in.datastring);
end ;