Windows Phone 7.1 WebClient POST without body -


i new web service calls; can simple , parse json output. not post , if uri has spaces , quotes.

i trying send following uri server in windows phone 7.1 (emulator). says "not found error". error seems generic; doesn't what's wrong anyway.

https://aaabbb.com//services/v4/put/users/xxxxx/device?deviceid=2ndjdrki5mevfme -h 'access: token token=cxjty'

there no json body/data this. url shown params. thats data too.

how do webclient class or restsharp? tried using webclient class in wp 7. didn't succeed. downloaded restsharp; not sure how above uri without json data sent.

i followed of posts in here use weclient class. didn't work.

you need url-encode string. that, can this:

string deviceid = httputility.urlencode("2ndjdrki5mevfme -h 'access: token token=cxjty'"); uri uri = new uri("https://aaabbb.com/services/v4/put/users/xxxxx/device"); string data = "deviceid=" + deviceid; webclient wc = new webclient(); wc.headers(httprequestheader.contenttype) = "application/x-www-form-urlencoded"; wc.uploadstringasync(uri, data); wc.uploadstringcompleted += wc_uploadcomplete; 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -