1

First of all, check the following image:

enter image description here

The left part represents jquery´s POST:

($.post("localhost:65066/Store/Browse2?QualificatifsIDs=483", { responseType: "json" })

And the right is angular´s POST:

($http.post("localhost:65066/Store/Browse2?QualificatifsIDs=483", { responseType: "json" }))

The left result is the expected one. Why is there a difference?

David Spence
  • 7,999
  • 3
  • 39
  • 63

1 Answers1

0

Jquery request: Content-Type:application/x-www-form-urlencoded; charset=UTF-8

Angular request: Content-Type:application/json;charset=UTF-8

How do I POST urlencoded form data with $http in AngularJS?

Also do you want the response type in the payload or as a config option?

$http.post("localhost:65066/Store/Browse2?QualificatifsIDs=483", {}, { responseType: "json" })
Community
  • 1
  • 1
Cadoo
  • 807
  • 5
  • 13