title: How to correctly request a geoserver WFS via POST?
body: <p>I have a <a href="http://geoserver.org/" rel="noreferrer">geoserver</a> instance, that contains our data. Requesting this via GET works all-right and returns the expected results. But sadly it doesn't works with POST.</p>
  
  <p>To be precise, here is the request for the Capabilities with GET, that returns a valid GetCapabilities-Response:</p>
  
  <pre><code>http://myserver:8080/geoserver/wfs?service=wfs&amp;version=1.1.0&amp;request=GetCapabilities
  </code></pre>
  
  <p>I test this with wget, so the command looks like that: </p>
  
  <pre><code>wget -O wfs 'http://myserver:8080/geoserver/wfs?service=wfs&amp;version=1.1.0&amp;request=GetCapabilities'
  </code></pre>
  
  <p>Now I try the Capabilities-request with POST. I create a file with the request (named request) with the following content:</p>
  
  <pre><code>&lt;GetCapabilities
   service="WFS"
   xmlns="http://www.opengis.net/wfs"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs
   http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"/&gt;
  </code></pre>
  
  <p>This I run against the Geoserver with the following wget:</p>
  
  <pre><code>wget -O wfs --post-file=request 'http://myserver:8080/geoserver/wfs'
  </code></pre>
  
  <p>But now I get an OWS-Exception:</p>
  
  <pre><code>&lt;ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://moa:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd"&gt;
    &lt;ows:Exception exceptionCode="MissingParameterValue" locator="request"&gt;
      &lt;ows:ExceptionText&gt;Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@1e5c2cc&lt;/ows:ExceptionText&gt;
    &lt;/ows:Exception&gt;
  &lt;/ows:ExceptionReport&gt;
  </code></pre>
  
  <p>This looks like no POST-body has been sent or it was ignored. What do I wrong here?</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: OK, I solved the problem. The problem is Geoserver expects a Content-Type-Header for Posting a XML-File. So correct request looks like the following:</p>
  
  <pre><code>wget -O wfs --header='Content-Type: text/xml' --post-file=request.xml 'http://myserver:8080/geoserver/wfs'
  </code></pre>
  
  <p>This returns the expected result.</p>