how to do http post with tschttpwebrequest with tsl 1.2
Posted: Tue 27 Aug 2019 01:21
I’m using devart securebridge tschttpwebrequest to do a http post to a server with tsl 1.2.
I got this error EScError with message 'Socket closed. Cannot receive data'
I set the property tsl1.2 to true.
Below is my snippet code, any mistake or something I missed ?
ScHttpWebRequest1.RequestUri:='https://blablabla';
ScHttpWebRequest1.Method:= rmPost;
ScHttpWebRequest1.Accept:='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
ScHttpWebRequest1.ContentType := 'application/json';
Buf := TEncoding.UTF8.GetBytes(jsonResult.ToString);
ScHttpWebRequest1.ContentLength := Length(Buf);
ScHttpWebRequest1.WriteBuffer(Buf);
httpwebresponse := ScHttpWebRequest1.getresponse;
I got this error EScError with message 'Socket closed. Cannot receive data'
I set the property tsl1.2 to true.
Below is my snippet code, any mistake or something I missed ?
ScHttpWebRequest1.RequestUri:='https://blablabla';
ScHttpWebRequest1.Method:= rmPost;
ScHttpWebRequest1.Accept:='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
ScHttpWebRequest1.ContentType := 'application/json';
Buf := TEncoding.UTF8.GetBytes(jsonResult.ToString);
ScHttpWebRequest1.ContentLength := Length(Buf);
ScHttpWebRequest1.WriteBuffer(Buf);
httpwebresponse := ScHttpWebRequest1.getresponse;