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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Invoke web service enc...
Power Automate
Suggested Answer

Invoke web service encodes body to ascii??

(0) ShareShare
ReportReport
Posted on by 85
Im trying to do a post request in PAD. I am using the Invoke Web Service action but getting a 400 error.  
 
Tried the same request in Postman and that works.  SO i checked in Fiddler and realised that the request body is being encoded to ASCII and that is not accepted by the server.  I already tried setting the COntent-Type to utf-8. 
 
what are my options please?
I have the same question (0)
  • Suggested answer
    VishnuReddy1997 Profile Picture
    2,656 Super User 2025 Season 2 on at
    Hi @deg85,
     
    Instead of just setting the Content-Type header, try specifying the encoding in the request body explicitly:
     
    1. Use Content-Type: application/json; charset=utf-8 (if JSON)
    2. Use Content-Type: text/plain; charset=utf-8 (if plain text)
     
    Or try encoding using any one the scripting language before.
     
    Or you can also try this python code to perform post action in Power Automate desktop.
     
    import requests
    
    # API endpoint
    url = "https:"  # Replace with the actual API URL
    
    # Plain text body
    text_body = (
        "Your Body"
    )
    
    # Headers
    headers = {
        "Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
    }
    
    # Sending the POST request
    response = requests.post(url, data=text_body.encode("utf-8"), headers=headers)
    
    # Print response
    print("Status Code:", response.status_code)
    print("Response Body:", response.text)
    
     
     
    (Note:- if you got your solution you can mark as solution and gives kudos)
     
    Thanks & Regards
    Vishnu Reddy

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard