Parameter of service is null Xdata Server

Hello

I'm testing the demo TMS XData\Demos\firedac-sql\server

When i call POST http://localhost:2001/tms/firedacsql/customers with

{
    "id": 7,
    "name": "my test",
    "country": "test"
  }

The procedure CreateCustomer(Customer: TCustomer);
is trigered but the object "Customer is empty !

I tested with swagger, it's ok but not with delphi RestDebugger or Bommerang google add-on .

Why the object is empty ?

Thank you.

Delphi 11, win 11 x64

If it works with Swagger but not with other tools, please give more details about how you are doing the requests with such tools. It's of course some wrong configuration.

Thank you for reply.

I tested with Bommerang add-on, PostMan and Delphi RestDebugger

With PostMan :

image_dev

When i debug with swagger i have this:
image
image

And with Bommerang:
image

image

Thank you.

And what is the full response you get (headers and response body) when you do such requests?

With Bommerang :

 204  No Content, 2116ms, undefined

content-length: 0
date: Wed, 12 Jul 2023 13:27:04 GMT
server: Microsoft-HTTPAPI/2.0
xdata-version: 2

With Swagger

HTTP/1.1 204 No Content
Content-Length: 0
Server: Microsoft-HTTPAPI/2.0
xdata-version: 2
Date: Wed, 12 Jul 2023 13:01:54 GMT

It looks everything is ok, the response is the same.

Yes, but i don't understand why with swagger the customer is no empty.

The only difference that i can see , it's in the header request
on swagger : Sec-Fetch-Site = Same-origin
on bommerang : = Sec-Fetch-Site = none

I don't use the other tools, but I use Postman. Do you see the same issue with Postman? If yes, please share the Postman request here so I can try to reproduce the issue.

Finally,

I found the difference,

The json in body of the request is case-sensitive.

Correct, JSON is always case-sensitive.
I recommend you set UnknownMemberHandling property of the TXDataServer to TUnknownMemberHandling.Error. This way, XData will raise an error if the JSON contains properties that it does not know.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.