none
HttpSend Activity with Url Encode RRS feed

  • Question

  • I've been using HttpSend Activity and the querystring contains some special characters. I've found the querystring is not encode automatically by the HttpSend activity. I was wondering if there's any activity or way to UrlEncode the querystring? I've tried BuildSPUri activity but it doesn't help.

    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Thursday, May 9, 2013 2:48 AM

All replies

  • Try to add System.Web refference. And in HttpSend Activity: 
    string.Format("http://host.com?param={0}",System.Web.HttpUtility.UrlEncode(param))
    

    Tuesday, October 22, 2013 7:04 AM
  • Hi,

    Workflow Manager doesn't allow you to use HttpUtility class as it's declarative workflow now and you can't add reference and use the API. You need to use existing activity and unfortunately there's no existing activity for url encode.


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Tuesday, October 22, 2013 10:46 AM
  • Hi,

    It's probably late for your problem but it could help some others, as I were 10mn ago :)

    I had a similar problem. Use a HttpSend activity with the accountname of the current user (such as i:0#.w|domain\user).

    With the BuildUri activity, I was able to obtain an encoded URL.
    I set a web service URL as "URI.Source" parameter and set the "Query" parameter with "accountname="+AccountName

    Then, my URL was encoded and I could use it in the HttpSend activity.


    • Proposed as answer by Pierre Fudala Wednesday, January 7, 2015 2:58 PM
    • Edited by Pierre Fudala Tuesday, January 20, 2015 11:49 PM
    Wednesday, January 7, 2015 2:57 PM