web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to send x-csrf-...
Power Automate
Unanswered

Unable to send x-csrf-token in POST request

(2) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Experts, 

 

I am trying to send POST request using HTTP connector. The Odata API required x-csrf-token to be sent as well. I could fetch token from previous GET request and trying to pass it to subsequent POST request. Though I could see it as input, API returns with a message 403 and CSRF token validation failed. The same works with POSTMAN. Please suggest.

Input :

pipa_0-1645209331757.png

 

Raw input :

pipa_3-1645209491550.png

 

Output

pipa_2-1645209382676.png

 

Regards,

 

Categories:
I have the same question (1)
  • japel Profile Picture
    4 on at

    Had the same issue for days and figured it out today:

     

    You need to submit the session cookie, which you will find in the "set-cookie" header of your GET request. 

    This needs to be passed to the POST request. Unfornately this can't be done using a custom connector. 

    I used a normal http request for this. You can set a Cookie Attribute there.

    For the info from "set-cookie" you need to replace "," with ";" before passing it to your POST-Request. 

  • TM82 Profile Picture
    6 on at

    can you plz elaborate and give the syntax for the post method

  • VDI Profile Picture
    337 on at

    Is it resolve? I am also getting the same error.

  • Abdollar Profile Picture
    3 on at

    Yes, it has been resolved.
    Modify this expression to yours "replace(outputs('Get_product')['headers']['Set-Cookie'],',',';')" to replace commas in your set-cookie.

  • VDI Profile Picture
    337 on at

    Thanks, I have replace the commas to semicolon, but still I am getting the CSRF token validation failed error.

    I am trying to connect to on-premise SAP System via data gateway and already did all the configuration but still unable to send cookies.

  • PowerPlatChadd Profile Picture
    13 on at

    Running into same issue, did you ever figure this out?

  • imranimzzy Profile Picture
    24 on at
    Here is the screenshot of how you pass the cookie getting from the GET x-csrf-token call. Please accept this as a solution if it resolves your query.

    1. Getting the csrf token
    2. In Compose replacing the set-cookie value ',' with ';'.
    3. POST call by sending the Cookie value.

  • PC-28030728-0 Profile Picture
    2 on at
    Hi Guys, I'm new to power apps. I'm using custom connection to generate CSRF token. I managed to get 200 response but the x-csrf-token is not included in the Header respone. Appreciate if someone can help me. Big help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard