Restangular not setting headers on post

前端 未结 3 390
后悔当初
后悔当初 2021-01-27 19:40

I am trying to set the header for a single post request using restangular but the request is being sent as plain text instead of json. I have read the documentation here as wel

3条回答
  •  执念已碎
    2021-01-27 20:31

    Don't pass two empty objects, try passing:

    .post(pip, undefined, undefined, {'Content-Type':'application/json'})
    

    Or even .customPOST() instead of .post().

提交回复
热议问题