Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Web API: Post & Byte Arrays

$
0
0

I have some code that looks like this:

Role role = newRole();
role.Name ="MyName";
role.Password =newbyte[] {0x67, 0x90, 0x74};
response = client.PostAsJsonAsync("role", role).Result;

When executing this the controller throws an exception because "Password" does not exists and it cannot be null. The Name "MyName" made it through but Password is non-existing. Why does Password not make it to the controller and how can I make this work?


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>