title: Delphi XE5 : JSON Send from client TRESTRequest Body received as text/plain
body: <p>I'm Trying to send JSON using RESTClient (Delphi XE5, Windows 8) from client side. But on server side it received as text/plain data.</p>
  
  <p>The JSON i'm trying to send :</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "kind": "News",
    "group": {
      "id": "G01"
    },
    "title": "Latest News",
    "content": "this is the latest news"
  }
  </code></pre>
  
  <p>Received On Server Side :</p>
  
  <pre>
      ----------120515234155952
      Content-Disposition: form-data; name="body"
      Content-Type: text/plain
      Content-Transfer-Encoding: quoted-printable
  
      {
        "kind": "News",
        "group": {
          "id": "G01"
        },
        "title": "Latest News",
        "content": "this is the latest news"
      }
      ----------120515234155952
      Content-Disposition: form-data; name="access_token"
      Content-Type: text/plain
      Content-Transfer-Encoding: quoted-printable
  
      ya29.QQKUa6ZDsco2uDK2neuYdurolLF8LAPDjMZGTdF3bnDLOIgX1JQ8g-FxKtMLSF-gl=
      MDY
      ----------120515234155952--
  </pre>
  
  <p>The code used to add JSON to TRESTRequest:</p>
  
  <pre><code>var
    ........
    RESTRequest : TESTRequest;
    content : String;
    ........
  begin
  
    ........
  
    content:='{'+
          '  "kind": "News",'+
          '  "group": {'+
          '    "id": "G01"'+
          '  },'+
          '  "title": "Latest News",'+
          '  "content": "this is the latest news"'+
          '}';
    RESTRequest.Params.AddItem('body',content,TRESTRequestParameterKind.pkREQUESTBODY,[],ctAPPLICATION_JSON);
  
    ............
  
  end;
  </code></pre>
  
  <p>I have tried to use another variations with no changes :</p>
  
  <ol>
  <li><code>RESTRequest.AddBody(Content);</code>  </li>
  <li><code>RESTRequest.AddBody(TJSONObject.ParseJSONValue(Content));</code>  </li>
  <li><code>RESTRequest.AddBody(TJSONObject.ParseJSONValue(Content),ctAPPLICATION_JSON);</code>  </li>
  <li><code>RESTRequest.AddBody(TJSONObject.ParseJSONValue(UTF8String(Content)),ctAPPLICATION_JSON);</code>  </li>
  </ol>
  
  <p>I find out that when executing <code>DoPrepareRequestBody</code> method (found on <code>unit REST.Client</code>) <code>TCustomRESTRequest</code> only use <code>LParam.Name</code> and <code>LParam.Value</code> for calling <code>MultipartPeerStream.AddFormField</code>. It means contentType always empty and MultiPartPeerStream translated it to text/plain.</p>
  
  <p>Is there any way to force its content type to <code>application/json</code>? </p>