PureConnect

 View Only

Discussion Thread View
  • 1.  Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-07-2020 17:00
      |   view attached
    Hi All, 

    I have the following body request ("{\"after\":\"1\",\"clinic\":\"https://www.example.com\",\"authorization\":\"ABCDEFJH\"}"),
    which I need to pass as Raw Request Body in the the REST HTTP REQUEST step, but it seems that the handler is escaping the URL part that's defined in the "Clinic" part, so is there any work-around to overcome this issue.



    Thank you.
    #Handlers

    ------------------------------
    Hussein Alshamiri
    Hadef Information Technology Co.
    ------------------------------


  • 2.  RE: Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-08-2020 13:34
    So not sure if the info in the request is completely accurate, but if it is, note that it is not good practice to send a JSON body or body at all in a "GET" request and so most web services will just ignore the body.  If you're not sure, it may be a "POST" HTTP Method that you're intending as this is more likely.

    Can you specify how you're verifying the request?  Are you sending this request to a custom web service that you have built?  If so, I recommend changing to a POST method instead of a GET, otherwise, if it is true request for data, then these parameters should be contained within the URL itself in a GET request (e.g. http://www.example.com?after=1

    ------------------------------
    Douglas Suyemoto
    Latham & Watkins LLP
    ------------------------------



  • 3.  RE: Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-08-2020 13:53
    Hi @Douglas Suyemoto,

    It's actually a GET request that the 3rd party vendor has provided us with to consume their API, and I have verified the request in a live session with the vendor ​and he confirmed that the "Clininc" value is empty whereas, when I test the same on POSTMAN everything works just fine. 


    Plus I'm checking with the vendor to allow these params to be appended with the URL, in parallel I'm looking for a work-around to overcome this issue with the handler being skipping the URL if it's in the body request! 

    Thank you.

    ------------------------------
    Hussein Alshamiri
    Hadef Information Technology Co.
    ------------------------------



  • 4.  RE: Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-08-2020 14:48
    If you have a development environment, you can turn IP up to 100 and see the contents of the request/body as it's being built.

    Another question, are you using the json builder tool to build your request body, or are you just using a literal value?

    I also agree with the other user that it's funky to have a GET request not use query string parameters and a request body instead.  The URI should be the driver in GET requests.


    ------------------------------
    AARON LAEL
    State of Utah
    ------------------------------



  • 5.  RE: Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-09-2020 02:36
    Hi Hussein,

    Have your tried encoding the URL?  not sure if it is relevant here, but I know that for special characters the HTTP REST tool expects special characters to be URL encoded.  But that might be only for the URL field itelf, but maybe it is worth the try inside the Request body as well?

    So https://www.example.com would look like this: https%3A%2F%2Fwww.Example.com

    You can use a site like this one to test your own specific URLs
    https://www.url-encode-decode.com/

    ------------------------------
    Egill Palsson
    Advania Sverige AB
    ------------------------------



  • 6.  RE: Passing a URL in the Handler ( REST HTTP ) Raw request body keep failing

    Posted 12-09-2020 07:48
    Thank you All We have managed to get it solve by appending the request in the URL as you guys suggested.

    ------------------------------
    Hussein Alshamiri
    Hadef Information Technology Co.
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources