I am trying to post an Image with JSON object to wcf service in a Request.
Also i need to have Contant-Type: application/json on the request. How can i do that?
Can anyone please show me how the request will look like and also how do i receive in WCF.
Currently i am receiving like that-
And sending request like-
I would like to be able to do something like that-
Any suggestion or link or code would be appreciated. Thanks
Just convert image binary data to base64 and send it as a regular field:
var imageBin = new byte[]{}; // need image data here
var base64Img = Convert.ToBase64String(imageBin);
var json =
@"{
'someData' : 'someValue',
'image' : '" + base64Img + @"'
}";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.