Look at the API for $httpbackend
, we can see that functions like expectPut
can take up to 4 parameters. The second parameter can be a function which takes 1 parameter: a string. This string represents the body of the HTTP request.
But why is it a string? Wouldn't it make more sense for it to be JSON? Is there a technical reason why Angular needs to give me the body back as a string instead of JSON?