jquery - How to POST data on payload instead of formdata -
i'm trying make request alfresco service web-script made, passing json data on payload.
this alfresco service:
http://localhost:8080/share/proxy/alfresco/api/internal/downloads
and need pass json array whit script node, that:
var jsondata = "[{'noderef':'workspace://spacesstore/920b43d4-e79c-40eb-96f3-1dff3a169929'}, {'noderef':'workspace://spacesstore/f19fba4b-0cf6-4379-a858-70d0d7d9efb0'},{'noderef':'workspace://spacesstore/6ea51288-9364-4070-a23b-499025a6c1f9'}]";
i make call on way
$.ajax({ url: serviceurl, type: "post", datatype: "json", data: jsondata });
unfortunately when chek request list developer tools see json data passed form data on request , internal server error response.
i saw same service used on website , there data passed payload, so, think need data passed on payload.
does know how force ?
i think depends on content-type header of request; if content type "application/x-www-form-urlencoded" shown under form data. if put - example - content-type: application/json json should part of payload. can use:
$.ajax({ url: serviceurl, type: "post", datatype: "json", data: jsondata, contenttype: "application/json" });
Comments
Post a Comment