Forum Discussion

nganapathiraju's avatar
nganapathiraju
Former Employee
9 years ago

Rest post cookies

Continuing the discussion from Request Body in Rest API Pipeline:

@tstack @dmiller

Can you guys take a look at this?

This request needs a Cookie to be sent across and authenticated via our REST POST snap.

I have tried the same request in SOAPUI and it works. I was trying to get it to work in POSTMAN but even with Interceptor that handles Cookies, I was unable to do it.

Can you guys suggest what else could be done?

Here is my pipeline.
https://elastic.snaplogic.com/sl/designer.html?pipe_snode=598b5f21a92066355787c461&active_org=ConnectFasterInc

2 Replies

  • tstack's avatar
    tstack
    Former Employee

    There needs to be a space after the semi-colon in the cookie header:

    'JSESSIONID=' + $SessionID + '; ' + $Token

    Also, the X-XSRF-TOKEN header should have just the token value and not ‘XSRF-TOKEN=“…”’. I extracted the token like so:

    $Token.match(/="(.*)"$/)[1]

    The query is also not well-formed, I replaced the JSON.stringify() with:

    {"FirstName":$FirstName, "LastName": $LastName}

    Here’s the updated version I was trying on UAT.

    NG_Join_Search1_2017_08_10 (1).slp (16.2 KB)