zhang-pc / mockwebserver

Automatically exported from code.google.com/p/mockwebserver
Apache License 2.0
0 stars 0 forks source link

Illegal argument exception with jersey-client post request with empty body #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Set up mockwebserver and enqueue a request 
server.enqueue(new MockResponse(...));
server.play();
2. Create a jersey-client and make a post without a body: 
client.resource(server.getURL("/")).path("/").post(MyResponseType.class)

What is the expected output? What do you see instead?

I get an IllegalArgumentException from MockWebServer.java, readRequest() 
method.  

What version of the product are you using? On what operating system?

The only public release. 

Please provide any additional information below.

MockWebServer checks for a non-empty POST body and fails if empty. Should this 
be the right behaviour? Curl seems to allow POST's without body (or provide 
empty body?). I'm bringing curl here because I have to implement an API that 
allows this: 

 curl -X POST -u admin:admin \
  'http://localhost:7180/api/v1/clusters/Cluster%201%20-%20CDH4/services/my_hbase/commands/hbaseCreateRoot'

Original issue reported on code.google.com by stan.ieu...@gmail.com on 10 Aug 2012 at 12:12

GoogleCodeExporter commented 9 years ago
Yup, that's a valid problem. Apologies for the horrible delay on fixing this.

Original comment by limpbizkit on 3 Mar 2013 at 2:43