c# - Send Image in Json : 400 Bad request -
from android trying send image class of data, iis webservice. (c#)
the problem 400 bad request
.
the image being encoded base64
. , placed json
rest of class elements.
my guess base64 not valid inside json. server not understand it. if set string ""
, post accepted fine.
so question is, how make base64
valid within json
array? ( tried url.encode no success).
or how should send image android webservice?
gson gson = new gson(); string json = gson.tojson(record); // record has param { string base64photo }
how big image? i'm pretty sure surpassing iis json size limit (default 4 mb).
check http://geekswithblogs.net/frankw/archive/2008/08/05/how-to-configure-maxjsonlength-in-asp.net-ajax-applications.aspx or http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits
good luck!
Comments
Post a Comment