Jump to content

annie_cyy@yahoo.ca

Members
  • Content Count

    4
  • Joined

  • Last visited

Posts posted by annie_cyy@yahoo.ca


  1. On 1/11/2022 at 2:26 PM, Remy Lebeau said:

    There are a lot of things wrong with this code.  The first thing that stands out to me is the BaseURL and ProxyServer are using the same Host/IP, why? That makes no sense to me. Also, if you are trying to *send* a request in 'multipart/form-data' format, you should be setting that in the 'Content-Type' request header, not in the 'Accept' request header.  Also, 'UTF8' is not a valid content encoding for the 'Accept-Encoding' request header.

     

    Can you provide some details about what the REST API is actually expecting you to send to it?

    Thank you so much,the problem is in ProxyServer, Removed it, perfect. 


  2. Tool is Delphi XE 10.3,

    In Windows 8 or Windows10  run perfect, but run in Windows 7 , it got error message like title

    " REST request failed: Error sending data: (12152) The server returned an invalid or unrecognized response" .

    Somebody can help me?  

     

    procedure TForm1.MCloud_Prepare_RequestR();
    var
        __securityAppName   : String;
        __searchSymbol      : String;
        __globalID          : String;
    begin
         RESTRequest.Method := TRESTRequestMethod.rmPOST;
         RESTClient.Accept:='multipart/form-data';
         RESTClient.BaseURL := CURL+':Port#/v1/auth/token';
         RESTClient.ProxyPort:=9999;
         RESTClient.ProxyServer:=CURL;
         RESTClient.ProxyUsername:='CloudTest';
         RESTRequest.AcceptEncoding:='UTF8';
         RESTRequest.AddParameter('id','12345',TRESTRequestParameterKind.pkREQUESTBODY);
         RESTRequest.AddParameter('client_id',CCLIENT_ID,TRESTRequestParameterKind.pkREQUESTBODY);
         RESTRequest.AddParameter('secret',CSECRET,TRESTRequestParameterKind.pkREQUESTBODY);

        RESTRequest.Execute;
    end;

×