我有POST方法的ajax请求。请求将Json数据发布到服务器。我想这个JSON解析到一个像这样的字符串:Json在泽西岛中的字符串
@POST
@Path("file/save")
@Consumes(MediaType.APPLICATION_JSON)
public void save(String content) {
}
我得到这个错误每次我尝试对服务器的请求:
“错误400无法反序列化java.lang.String中的实例出START_OBJECT令牌”
下面是详细的POST请求:
Request URL: http://localhost:8181/file/save
Request Method:POST
Status Code:400 Bad Request
Request Headers
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:379
Content-Type:application/json
Cookie:JSESSIONID=0AFC5FF7F201391DD67CCB0DA1BCD25C
Host:localhost:8181
Origin:http://localhost:8181
Referer:http://localhost:8181
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36
X-Requested-With:XMLHttpRequest
Query String Parameters
Request Payload
<my json data>
Response Headers
Cache-Control:must-revalidate,no-cache,no-store
Content-Length:1369
Content-Type:text/html;charset=ISO-8859-1
Date:Wed, 11 Sep 2013 03:11:03 GMT
Server:Apache-Coyote/1.1
我该如何解决这个问题?谢谢!
**,**,**是产生400的HTTP POST请求?请包括所有标题和正文。 –