locked
How to pass the %0A in the uri template using the wcf rest service RRS feed

  • Question

  • User1189133030 posted

    hello everyone I'm trying to create the WCF rest service to upload the comments but my service will work fine if I use the space but when I use the enter or new line (\n or %oA) in the Uri template then the service will give the error like HTTP Error 400. The request URL is invalid.

     [OperationContract]
    [WebInvoke(Method = "POST", UriTemplate = "comment/{comments}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    string comment(string comments);

    Any suggestions how to solve this issue thanks in advance

    Monday, February 20, 2017 11:52 AM

Answers

  • User475983607 posted

    Don't send the "comments" in the URL send the comments in the HTTP body.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 20, 2017 2:53 PM

All replies

  • User475983607 posted

    Don't send the "comments" in the URL send the comments in the HTTP body.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 20, 2017 2:53 PM
  • User1189133030 posted

    Hi mgebhard can you show some code or example 

    Thanks,

    Tuesday, February 21, 2017 4:45 AM
  • User1189133030 posted

    Hi mgebhard can you show how to take the values from the HTTP body 

    Thanks,

    Tuesday, February 21, 2017 5:17 AM