1
rated 0 times
[
7]
[
6]
/ answers: 1 / hits: 6990
/ 10 Years ago, thu, march 27, 2014, 12:00:00
How can I send a nested object via POST request?
var name = test,
path = ?diffCurr%5B%5D=FALSE&diffProv%5B%5D=FALSE,
data = {
datatype:report,
value:{
name:name,
query:path
}
};
$.ajax({
type:POST,
url: resources/savedata.html,
data: data,
success: function(data){
...
},
complete: function(){
...
}
})
When I check in the chrome, in the network tab under form data, I see this:
datatype:report
value[name]:test
value[query]:?diffCurr%5B%5D=FALSE&diffProv%5B%5D=FALSE
Basically, I was expecting $_POST[value]
to contain an object with name
and query
.
More From » php