none
wcf rest json URL parameters encode RRS feed

  • Question

  • hi, experts, I am using wcf rest json for mobile app.

    one uri is to receive string and then post back but the string is a url.

    the mobile scans a qrcode (string is url) and then post the url to server.

    the uri template is "QRCode/{qrCodeURL}"

    [WebInvoke(UriTemplate = "QRCode/{qrCodeURL}", Method = "POST", RequestFormat = WebMessageFormat.Json)]

    e.g. {qrCodeURL} = "http://www.google.com"

    I tried to use HttpUtility.UrlDecode, HttpUtility.UrlPathEncode and Uri.EscapeDataString but the server always respond "bad request 400".

    how to solve?

    Thank you very much!

    Monday, June 9, 2014 5:37 AM

Answers