title: Why are my headers null after a POST?
body: <p>I'll lay down my code first:  Note:  I also have log output at the bottom of the question.</p>
  
  <p>Server Side:</p>
  
  <pre><code>@Post
  @Consumes("application/octet-stream")
  public Representation post(InputStream zip, @HeaderParam(value = "Content-Disposition") HttpHeaders headers) throws Throwable {
      System.out.println(headers); //Prints null - want the header to not be null here
      String uploadedFileLocation = getStartingDir() + "/" + "abc.zip";
      writeToFile(zip, uploadedFileLocation); 
      return new StringRepresentation("Uploaded!");
  }
  </code></pre>
  
  <p>Client Side:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      final String BASE_URI = "http://localhost:8080/server/upload";
  
      Client client = Client.create();
      WebResource service = client.resource(BASE_URI);
      client.setChunkedEncodingSize(1024);
      client.addFilter(new LoggingFilter());
  
  
      File zip = new File("C:/Users/sdery/Desktop/abc.zip");
  
      InputStream fileInStream = new FileInputStream(zip);
      String sContentDisposition = "attachment; filename=\"" + zip.getName()+"\"";     
      ClientResponse response = service.header("Authorization", "Basic xxx=").header("Content-Disposition", (Object)sContentDisposition).type(MediaType.APPLICATION_OCTET_STREAM).post(ClientResponse.class, fileInStream);     
      System.out.println("Response Status : " + response.getEntity(String.class));
  
  }
  </code></pre>
  
  <p>First off, the file transfer works, I'm happy.  However, I would like to get the headers on the server side so I don't have to hard code the file name.  Any ideas as to why it is comin' up null?  Does it have to do with me using <code>ClientResponse</code> instead of <code>ClientRequest</code>?</p>
  
  <pre><code>Jul 31, 2013 8:44:12 AM com.sun.jersey.api.client.filter.LoggingFilter log
  INFO: 1 * Client out-bound request
  1 &gt; POST http://localhost:8080/server/upload
  1 &gt; Content-Disposition: attachment; filename="abc.zip"
  1 &gt; Authorization: Basic xxx=
  1 &gt; Content-Type: application/octet-stream
  
  (zip bytes)
  
  INFO: 1 * Client in-bound response
  1 &lt; 200
  1 &lt; Date: Wed, 31 Jul 2013 12:44:12 GMT
  1 &lt; Date: Wed, 31 Jul 2013 12:44:12 GMT
  1 &lt; Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
  1 &lt; Content-Length: 88
  1 &lt; Set-Cookie: rememberMe=deleteMe; Path=/server; Max-Age=0; Expires=Tue, 30-Jul-2013   12:44:12 GMT
  1 &lt; Content-Type: text/plain; charset=UTF-8
  1 &lt; Accept-Ranges: bytes
  1 &lt; Server: Restlet-Framework/2.0.4
  1 &lt; Real-Token: bar
  1 &lt; 
  Uploaded!
  </code></pre>
  
  <p>From the log output, it seems that the header containing <code>Content-Disposition</code> is there.  Does this mean I should be able to retrieve the value from the server side code?</p>