Monday 15 March 2010

rss - Settings http headers in Java 6 SE httpserver -


I try to publish an Atom feed (generated with ROM) using the Java 6 SE server server. I need custom headers for the right feed discovery in Firefox.

This is my code:

  header header = e.getreuk header (); ArrayList & lt; String & gt; List = new ArrayList & lt; String & gt; (); List.add ("application / atom + xml"); Headers.put ("content-type", list); E.sendResponseHeaders (200, 0); Unfortunately the feed looks like XML (browser, what to feed, ask me) and sniffing with live httpheaders shows that there is no content-type feature.   

You can set response headers like this:

  Header header = Exchange.getResponseHeaders (); Headers.add ("content-type", "application / atom + xml"); Exchange.sendResponseHeaders (200, 0);  

No comments:

Post a Comment