Skip to main content
added 290 characters in body
Source Link
David
  • 220.7k
  • 42
  • 245
  • 337

You don't need to call JSON.stringify. This results in sending a string to the server, not an object. And since the WebAPI model binder is expecting a CL_CASE object, it has no way to populate that object from just a string.

Simply send the object itself:

data: payload

To be honest, I don't think you need the headers option at all in this case either. Let the default functionality handle it:

$http({
    method: 'post',
    withCredentials: true,
    dataType: 'json',
    data: payload,
    url: url
})

You don't need to call JSON.stringify. This results in sending a string to the server, not an object. And since the WebAPI model binder is expecting a CL_CASE object, it has no way to populate that object from just a string.

Simply send the object itself:

data: payload

You don't need to call JSON.stringify. This results in sending a string to the server, not an object. And since the WebAPI model binder is expecting a CL_CASE object, it has no way to populate that object from just a string.

Simply send the object itself:

data: payload

To be honest, I don't think you need the headers option at all in this case either. Let the default functionality handle it:

$http({
    method: 'post',
    withCredentials: true,
    dataType: 'json',
    data: payload,
    url: url
})
Source Link
David
  • 220.7k
  • 42
  • 245
  • 337

You don't need to call JSON.stringify. This results in sending a string to the server, not an object. And since the WebAPI model binder is expecting a CL_CASE object, it has no way to populate that object from just a string.

Simply send the object itself:

data: payload