How can I send a REST XML POST request via curl? <p>Basically, I have a project set up in Restlet which uses JAXRS for mapping resources to paths and uses JAXB for serializing and deserializing XML to/from Java types. I'm currently trying to send a POST request in order to test whether it works, and I'm running into a bit of trouble. Here's my resource:</p> <pre><code>@Path("stream") public class StreamResource { @POST @Consumes("text/xml") @Produces("text/xml") public Stream save(Stream value) { logger.debug("saving new stream..."); return (Stream)this.streamPersistence.save(value); } } </code></pre> <p>Here's my <code>Stream</code> class:</p> <pre><code>@XmlRootElement(name="stream") @XmlType(propOrder={"id", "streamName", "title", "description", fileSystemPath"}) public class Stream { private Long id; private String streamName; private String fileSystemPath; private String title; private String description; // getters/setters omitted for brevity } </code></pre> <p>And here's how I'm invoking <code>curl</code>:</p> <pre><code>curl -X POST -d '&lt;stream&gt;&lt;streamName&gt;helloWorld.flv&lt;/streamName&gt;&lt;title&gt;Amazing Stuff, Dude!&lt;/title&gt;&lt;description&gt;This stream is awesome-cool.&lt;/description&gt;&lt;fileSystemPath&gt;/home/rfkrocktk/Desktop/helloWorld.flv&lt;/fileSystemPath&gt;&lt;/stream&gt;' --header 'Content-Type:"text/xml"' http://localhost:8888/stream </code></pre> <p>Here's the error I'm getting from <code>curl</code>:</p> <pre><code>The given resource variant is not supported. </code></pre> <p>...and here's the error in Restlet:</p> <pre><code>15:02:25.809 [Restlet-961410881] WARN org.restlet.Component.Server - Error while parsing entity headers java.lang.IllegalArgumentException: Illegal token: "text at org.restlet.data.MediaType.normalizeToken(MediaType.java:647) at org.restlet.data.MediaType.normalizeType(MediaType.java:686) at org.restlet.data.MediaType.&lt;init&gt;(MediaType.java:795) at org.restlet.data.MediaType.&lt;init&gt;(MediaType.java:767) at org.restlet.engine.http.header.ContentTypeReader.createContentType(ContentTypeReader.java:84) at org.restlet.engine.http.header.ContentTypeReader.readValue(ContentTypeReader.java:112) at org.restlet.engine.http.header.ContentType.&lt;init&gt;(ContentType.java:99) at org.restlet.engine.http.header.HeaderUtils.extractEntityHeaders(HeaderUtils.java:664) at org.restlet.engine.http.connector.Connection.createInboundEntity(Connection.java:313) at org.restlet.engine.http.connector.ServerConnection.createRequest(ServerConnection.java:136) at org.restlet.engine.http.connector.ServerConnection.readMessage(ServerConnection.java:229) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:673) at org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) </code></pre> <p>What am I doing wrong here? This seems pretty straightforward, right? </p>