Re: ERRest should return own content type
Re: ERRest should return own content type
- Subject: Re: ERRest should return own content type
- From: Samuel Pelletier <email@hidden>
- Date: Thu, 31 Jan 2019 19:30:25 -0500
Hi André,
The mime is hard coded in the ERXXmlRestWriter.
Officially, text/xml and application/xml are valid, do you really need to
change it ?
You can probably write a subclass of ERXXmlRestWriter and override only the
public String contentType() method to return your desired mime and register the
class like this:
ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new YouXMLWirter(),
new ERXRestFormatDelegate(), ERXRestFormat.XML_KEY, "application/xml",
"text/xml");
Regards,
Samuel
> Le 31 janv. 2019 à 18:48, André Rothe <email@hidden> a écrit :
>
> Hi,
>
> I'm playing around with ERRest. I have some routes, which return data as XML.
> The content-type of the HTTP response is always text/xml, I try to change it
> to application/xml, but it seems not to work with setHeader() on the
> WOActionResult.generateResponse(). How I can set the header?
>
> Thank you
> André
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden