Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • vladzebu 59 posts 346 karma points
    Apr 10, 2012 @ 21:56
    vladzebu
    0

    Umbraco base XML parameter

    Hi  , 

    i need to have a rest extension that have input parameter an xml . 

    Will be something like : 

     public static bool MyRestExtension(string myXmlParameter) 

    How can i do it ? 

    I try to encode this url but it's not working , i receive next error : 

     

    A potentially dangerous Request.Path value was detected from the client (<).

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 11, 2012 @ 10:51
    Jeroen Breuer
    0

    You can't pass the xml as a parameter because the parameters which you pass to /base are in the url. Same reason why you can't pass a string which contains a / because the url would split it into 2 parameters. For the url I solved it like this:

    //Get the url through a post because it can't be passed as a parameter because it contains slashes which don't work with /base.
    string url = HttpContext.Current.Server.UrlDecode(HttpContext.Current.Request["url"]);

    I encoded the url and posted the value instead of adding it to a string.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft