API Post Bill create work fine but return 405 error

API Post Bill create work fine but return 405 error

Good day!
I'm developing an application with Embarcadero Delphi, from this application using the component TSslHttpCli package from Overbyte ICS and send a request for creating a new bill. 

Send in the json string before that checked me in Postman, and successfully created a new bill. When i send this json string using TSslHttpCli the bill also builds successfully, but the server returns an error 405 "Method not allowed". In the web interface, I see that the bill created. Why error is returned? 

Maybe I need to install some additional tuning parameters of the http header? My code:
  1. //encode national symbol to \uxxx
  2. function json_encode(str: String): String;
  3. var
  4.   i: Integer;
  5. begin
  6.   Result := '';
  7.   for i := 1 to Length(str) do begin
  8.     if Ord(WideString(str[i])[1]) > 127 then begin
  9.       Result := Result + '\u' + Format('%.4x', [Ord(WideString(str[i])[1])]);
  10.     end
  11.     else begin
  12.       Result := Result + str[i];
  13.     end;
  14.   end;
  15. end;
  16. procedure BeforeHeaderSendPostEvent(Sender: TObject; const Method: String; Headers: TStrings);
  17. begin
  18.    Headers.Add('Authorization: Zoho-authtoken ' + FAuthToken);
  19.    Headers.Add('Content-type: application/x-www-form-urlencoded');
  20. end;

  21. SslHttpCli := TSslHttpCli.Create(nil);
  22.   SslHttpCli.OnBeforeHeaderSend := BeforeHeaderSendPostEvent;
  23.   try
  24.     SslHttpCli.Timeout := 12 * 1000;
  25.     SslHttpCli.MultiThreaded := true;
  26.      SslHttpCli.RcvdStream := TMemoryStream.Create;
  27.     SslHttpCli.NoCache := true;
  28.     SslHttpCli.ServerAuth := httpAuthNone;
  29.     SslHttpCli.SslContext := TSslContext.Create(nil);
  30.     SslHttpCli.url := TIdURI.URLEncode(url);
  31.     SslHttpCli.SendStream := TStringStream.Create('JSONString='+json_encode(params));
  32.     try
  33.       SslHttpCli.Post;
  34.     except
  35.       on E: Exception do                  
  36.              showmessage(e.message); //show returned "Method not allowed"
  37.     end;
  38. if SslHttpCli.StatusCode = 200 then
  39.     begin
  40.             ;// some code
  41.       end
  42.       else
  43.       begin
  44.             showmessage('error code '+inttostr(SslHttpCli.StatusCode));
  45.       end;
JSON string sample:
  1. '{"vendor_id":"864114000000066015",
  2. "bill_number":"testbill",
  3. "date":"2017-09-12",
  4. "due_date":"2017-09-19",
  5. "payment_terms":"0",
  6. "exchange_rate":"0",
  7. "is_item_level_tax_calc":"false",
  8. "line_items":[
  9. {"name":"Test items1",
  10. "description":"Test items10 description",
  11. "account_id":"864114000000000370",
  12. "bcy_rate":"0",
  13. "rate":"800",
  14. "quantity":"5",
  15. "item_total":"0",
  16. "item_order":"0",
  17. "is_billable":"false"},
  18. {"name":"Test items2",
  19. "description":"Test items20 description",
  20. "account_id":"864114000000000370",
  21. "bcy_rate":"0",
  22. "rate":"16",
  23. "quantity":"250",
  24. "item_total":"0",
  25. "item_order":"0",
  26. "is_billable":"false"}],
  27. "taxes":[],
  28. "notes":"test notes"}'