Re: Unable to set Content-Type HTTP header to custom value

2021-08-24 Thread Claus Ibsen
On Tue, Aug 24, 2021 at 6:32 PM Calle Andersson wrote: > > I finally found a solution to my problem. It turned out 'contentTypeHeader' > could be set to 'false' in the following simple way: > restConfiguration().dataFormatProperty("contentTypeHeader", "false")... > > Now I am able to return respo

Re: Unable to set Content-Type HTTP header to custom value

2021-08-24 Thread Calle Andersson
I finally found a solution to my problem. It turned out 'contentTypeHeader' could be set to 'false' in the following simple way: restConfiguration().dataFormatProperty("contentTypeHeader", "false")... Now I am able to return responses with custom Content-Type values.

Re: Unable to set Content-Type HTTP header to custom value

2021-07-12 Thread Calle Andersson
As a complement to my last answer, one of the reasons I want to set a custom Content-Type value is because we include versioning in our custom media types (I skipped this part to simplify my example code in earlier mails). We simply want to use Content-Type to show the type and version of the da

Re: Unable to set Content-Type HTTP header to custom value

2021-07-02 Thread Calle Andersson
Thanks for the answer, The REST service is always called with the HTTP "Accept" header set as one of the custom media types ("application/my.dummy.mediatype+xml" or "application/my.dummy.mediatype+json"). The REST DSL based route uses the value of that HTTP header to populate the "Accept" heade

Re: Unable to set Content-Type HTTP header to custom value

2021-07-02 Thread Claus Ibsen
Hi Are you sure you want to set the Content-Type: Accept I think this is wrong. The content type is what the structure of the message body is, such as xml, plain text, json, etc. However there is a HTTP Accept header that a client can use to tell the server what content-type the client can accep