Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - Passing Header values to REST Services

Tags:

rest

delphi

I have a REST Service. By default, the JSON data being returned has all the NULLs eliminated. This is causing me difficulties, so I have a request header setting that changes the behavior. The request header I need to add is: Accept-Formatting: json-nulls=include

I have been able to get to work from POSTMAN, using the following format.

enter image description here

I have not been able to get this to work from my application.
My application has a TRestClient, TRestResponse and TRestRequest.

I have tried adding this as a parameter on both TRestClient and TRestRequest. While the REST service returns the data, the NULL fields are not being displayed, which tells me that my format (or something else relating to the request header) is not correct. Where and HOW should this be added?
Any thoughts appreciated.

enter image description here

like image 528
user1009073 Avatar asked Nov 08 '22 10:11

user1009073


1 Answers

Try directly call from Tools > Rest debugger, if all working copy/paste component to your project and try manuly change some parameter.

Example:

enter image description here

like image 191
user_odoo Avatar answered Nov 15 '22 05:11

user_odoo