开发者

dojo ---> django POST

开发者 https://www.devze.com 2023-04-12 03:39 出处:网络
I\'m trying to send a json from the client using the method xhrPost dojo. But I\'m getting a 403 errors. Any help?

I'm trying to send a json from the client using the method xhrPost dojo. But I'm getting a 403 errors. Any help?

var str_json = dojo.toJson(arr_markers);
console.log('json elements: '+str开发者_如何学运维_json);
dojo.xhrPost({postData: str_json,
               headers: { "Content-Type": "application/json"},
               //content:{'prueba': 'HOLA'},
               url:'/up_position_elements/',
               handleAs: 'text',
               load: function(response, ioArgs){alert('response');},
               error: function(errorMessage){}
});

And how to read the json in the django view?

Which method should I use?


403 means "forbidden" which means that the view wants a password, cookie, or other form of authentication. Could you show us the view that serves /up_position_elements/ so that we can see what security-related decorators or logic it might contain?

0

精彩评论

暂无评论...
验证码 换一张
取 消