[SOLVED] TFPHTTPClient getting code 202 from ASP.NET lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- martinrame · 2019-06-01 12:24 Hi, I need to do an HTTP GET against an ASP.NET 4 service that returns JSON. Using cURL I get the expected JSON result, but if I use TFPHTTPClient the server rejects the request with a code 202. Here's the cURL request: Code: [Select]curl -v "http://192.168.8.18:8285/efectores/1704/integra ciones/api/v1/solicitud- estudios?accessionNumber=21095&include=presentedForm" *   Trying 192.168.8.18... * Connected to 192.168.8.18 (192.168.8.18) port 8285 (#0) > GET /efectores/1704/integraciones/api/v1/solicitud- estudios?accessionNumber=21095&include=presentedForm HTTP/1.1 > Host: 192.168.8.18:8285 > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 200 OK < Cache-Control: no-cache < X-AspNet-Version: 4.0.30319 < Expires: -1 < Pragma: no-cache < X-Powered-By: ASP.NET < Content-Type: application/json; charset=utf-8 < Date: Sat, 01 Jun 2019 12:16:38 GMT < Transfer-Encoding: chunked < -- here's the JSON response-- Also I did a test using Python and it returned the expected result. Code: Python  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i import urllib2 # New lines begin herehttp_logger = urllib2.HTTPHandler(debuglevel = 1)opener = urllib2.build_opener(http_logger) # put your other handlers here too!urllib2.install_opener(opener)# End of new lines request = urllib2 .Request('http://192.168.8.18:8285/efectores/1704/integraciones/api/v1 /solicitud- estudios?accessionNumber=21095&include=presentedForm')response = urllib2.urlopen(request)print "Response code was: %d" % response.getcode() But using TFPHttpClient version I'm getting a 202 error: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i lHttpClient := TFPHttpClient.Create(nil);                                                                     lResponse := TStringList.Create;                                                                              try                                                                                                             lUrl := 'http://192.168.8. 18:8285/efectores/1704/integraciones/api/v1/solicitud- estudios?accessionNumber=21095&include=presentedForm';        lHttpClient.AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)');                                         lHttpClient.Get(lUrl, lResponse);                                                                           finally                                                                                                       lResponse.Free;                                                                                               lHttpClient.Free;                                                                                         end; The result is a status code 202. I use TFPHTTPClient in many projects without issues, but if I point to this specific server I get this wrong response, what can be happening?. ---------------------------------------------------------------------- martinrame · 2019-06-01 12:47 Sorry, please ignore this, it's working perfectly without changes.