#1 2023-11-29 08:06:16

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

Rest server do not include Content-Type in header

Hi ab, I have a situation where I only want to return http status code, currently the http rest server always sets Content-Type header to json unless overriden but there doesn't seem to be an easy way to control this via context in method based services.
It would be nice if there was a boolean property in TRestServerUriContext that would control that or even better if there were another overloaded Returns method that only specifies the status code.

best regards

Offline

#2 2023-11-29 15:16:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,203
Website

Re: Rest server do not include Content-Type in header

IIRC the HTTP standard request a Content-Type, even if there is no content body returned.

It won't hurt the communication performance if a Content-Type is transmitted anyway.

Offline

Board footer

Powered by FluxBB