c# - MVC 6 Post action parameter is null -


i have mvc 6 application , separate mvc 6 webapi service.

i send object application using code: enter image description here

this view part of it: enter image description here

the client sends webapi service: enter image description here

where parameter null:

enter image description here

in fiddler log 0 content-length:

enter image description here

what else should set?

it important set encoding , media type of stringcontent. if use postasjsonasync take care of part - unfortunately can't use in dnx.

so proper code of client:

  string content = newtonsoft.json.jsonconvert.serializeobject(blog);   httpresponsemessage response = await client.postasync("api/values", new stringcontent(content, encoding.utf8,"application/json")); 

Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -