I work with java servlets and I want to receive Big json data from client.
my client code is
url: "http://localhost:8080/JsonTest/setJson",
type: "POST",
dataType: 'json',
contentType: 'application/json',
data:{json:str},
my server code is
String json=request.getParameter("json");
but json variable is null
Can anybody help me?
try JSON.stringify on the data:
url: "http://localhost:8080/JsonTest/setJson",
type: "POST",
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({json:str}),
or if str is already a json string:
url: "http://localhost:8080/JsonTest/setJson",
type: "POST",
dataType: 'json',
contentType: 'application/json',
data: str,