我正在为 Web API 构建负载测试,但其中一个无法正常工作。
url 有点像http://myserver/myapp/mymethod
,它调用一个 java 方法,比如public void mymethod(mytype param)
而且我不知道如何传递该参数...
我收到此错误:
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method (Cannot consume content type).
编辑:
我试过设置Content-Type = "application/json"
和传递一个 json 参数,但现在服务器说: An error occured while trying to do a POST request.: java.net.SocketException: Unexpected end of file from server
该参数是正确的,我可以在调试 web 服务时获取值是:
{
"email": "name@server.com",
"login": "name",
"password": "1234"
}