title: TRESTRequest JSON POST issue in Delphi
body: <p>I'm trying to send JSON POST request to an API using a TRESTClient (Delphi 10.4/Windows 10), but I'm receiving a <strong>409 conflict indicating &quot;No input found&quot;</strong>. Using the same code in (Delphi XE6/Windows 10) I get a <strong>REST request failed: Socket Error # 10054 Connection reset by peer.</strong>. Using WireShark I was able to see that Delphi XE6 was sending the request with TLS 1.0 and Delphi 10.4 is using TLS v1.2. The API service accepts only TLS v1.2. Is there a way to use these REST components in Delphi XE6 to deliver the request with TLS 1.2?</p>
  <p>I beleived my problem was that I was JSON encoding all the input with the code:</p>
  <pre><code>// Assign JSON
    sl := TStringList.Create;
    sl.Add('locations=[{&quot;address&quot;:&quot;Test1&quot;,&quot;lat&quot;:&quot;52.05429&quot;,&quot;lng&quot;:&quot;4.248618&quot;},{&quot;address&quot;:&quot;Test2&quot;,&quot;lat&quot;:&quot;52.076892&quot;,&quot;lng&quot;:&quot;4.26975&quot;},{&quot;address&quot;:&quot;Test3&quot;,&quot;lat&quot;:&quot;51.669946&quot;,&quot;lng&quot;:&quot;5.61852&quot;},{&quot;address&quot;:&quot;Sint-Oedenrode, The Netherlands&quot;,&quot;lat&quot;:&quot;51.589548&quot;,&quot;lng&quot;:&quot;5.432482&quot;}]');
  </code></pre>
  <p>and then assigning it to the Request Body with <code>RESTRequest.AddBody(sl);</code>, whereas the API only expects the value of the locations parameter to be JSON.
  I have updated the code to assign the JSON to a String and used the <code>RESTRequest.Params.Items[0].name := 'locations';</code> and <code>RESTRequest.Params.Items[0].Value := s;</code> to add the string to the request body.</p>
  <p>Here's my updated code:</p>
  <pre><code>procedure TMainForm.btn_RouteXL_PostClick(Sender: TObject);
  var
    s, sResult, AError: String;
    jsObj: TJSONObject;
    AJSONValue, jsResponse: TJSONValue;
    AParameter: TRESTRequestParameter;
    AStatusCode: Integer;
  
  begin
    //ResetRESTComponentsToDefaults;
  
    s := '[{&quot;address&quot;:&quot;Test1&quot;,&quot;lat&quot;:&quot;52.05429&quot;,&quot;lng&quot;:&quot;4.248618&quot;},{&quot;address&quot;:&quot;Test2&quot;,&quot;lat&quot;:&quot;52.076892&quot;,&quot;lng&quot;:&quot;4.26975&quot;},{&quot;address&quot;:&quot;Test3&quot;,&quot;lat&quot;:&quot;51.669946&quot;,&quot;lng&quot;:&quot;5.61852&quot;},{&quot;address&quot;:&quot;Sint-Oedenrode, The Netherlands&quot;,&quot;lat&quot;:&quot;51.589548&quot;,&quot;lng&quot;:&quot;5.432482&quot;}]';
  
    RESTClient.BaseURL := 'https://api.routexl.com/tour';
    RESTClient.ContentType := 'ctAPPLICATION_X_WWW_FORM_URLENCODED';
    RESTClient.Authenticator := HTTPBasic_RouteXL;
  
    RESTRequest.Method := TRESTRequestMethod.rmPOST;
  
    RESTRequest.Params.AddItem; //Adds a new Parameter Item
    RESTRequest.Params.Items[0].name := 'locations'; //sets the name of the parameter. In this case, since I need to use 'locations=' on the request, the parameter name is locations.
    RESTRequest.Params.Items[0].Value := s; //Adds the value of the parameter, in this case, the JSON data.
    RESTRequest.Params.Items[0].ContentType := ctAPPLICATION_X_WWW_FORM_URLENCODED; //sets the content type.
    RESTRequest.Params.Items[0].Kind := pkGETorPOST; //sets the kind of request that will be executed.
  
    RESTRequest.Execute;
  
    try
      memo_ResponseData.Lines.Add('************JSONText*******************');
      memo_ResponseData.Lines.Add(RESTResponse.JSONValue.ToString);
      //Memo1.Lines.Add('JSONValue  :'+RESTResponse.JSONValue.Value);
      memo_ResponseData.Lines.Add('StatusText :'+RESTRequest.Response.StatusText );
      memo_ResponseData.Lines.Add('StatusCode :'+IntToStr(RESTRequest.Response.StatusCode ));
      memo_ResponseData.Lines.Add('ErrorMesage:'+RESTRequest.Response.ErrorMessage);
      memo_ResponseData.Lines.Add('************Content*******************');
      memo_ResponseData.Lines.Add(RESTRequest.Response.Content);
      memo_ResponseData.Lines.Add('************Headers*******************');
      memo_ResponseData.Lines.Add(RESTRequest.Response.Headers.Text);
    except
      on E: Exception do
      begin
        memo_ResponseData.Lines.Add('************Error*******************');
        memo_ResponseData.Lines.Add('Error : ' +E.Message);
        memo_ResponseData.Lines.Add(E.ClassName);
        memo_ResponseData.Lines.Add('************Error*******************');
        memo_ResponseData.Lines.Add('Error : '+RESTResponse.Content);
      end;
    end;
  
  end;
  </code></pre>
  <p>I'm able to get it to work in Postman using a key-value pair, by assigning the key as locations and the value as the contents of <code>sl</code> as seen in the screenshot. But I'm unable to translate that to Delphi.</p>
  <p><a href="https://i.stack.imgur.com/WIefE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WIefE.png" alt="enter image description here" /></a></p>