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 / use HTTP connector for...
Power Automate
Unanswered

use HTTP connector for x-www-form-urlencoded body (for Twittier API)

(0) ShareShare
ReportReport
Posted on by 9

I’m trying to use the twitter media API to upload an image and i’m struggling to understand how to structure the body of the HTTP connector into x-www-form-urlencoded body type. I've been trying to replicate the same using the Postman 'raw' body type and can't get it to work there either, but i can get it to work through the x-www-form-urlencoded body within Postman

If i create a variable ‘media=iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII’ I can generate a 200 response using the x-www-form-urlencoded body

 

scales23456_0-1713990294797.png

 

When i put the same body in Raw with a forced x-www-form-urlencoded header I get a 401 Unauthorized (which i think is just a poor error message bubbling up giving my Auth headers aren’t changing. The same thing happens in my PowerAutomate flow.

 

scales23456_1-1713990294788.png

 

I presumed this was to do with URLEncoding, so i encoded the value to the below, but this doesn't work in either PowerAutomate or the HTTP connector. Whats more confusing, is the encoded value stops the x-www-form-urlencoded tab working within Postman too. 

Does anyone know how to structure the HTTP conector body, so it will simulate the same behaviour I get when using the x-www-form-urlencoded tab?

Encoded
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD%2BwSzIAAAABlBMVEX%2F%2F%2F%2B%2Fv7%2BjQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD%2FaNpbtEAAAAASUVORK5CYII
Request:
POST https://upload.twitter.com/1.1/media/upload.json?
Documentation:
POST media/upload | Docs | Twitter Developer Platform

Categories:
I have the same question (0)
  • scales23456 Profile Picture
    9 on at

    HTTP Connector for reference. I've tried every combination i can think of it the body

    scales23456_0-1713994950985.png

     

  • v-yueyun-msft Profile Picture
    on at

    Hi , @scales23456 

    Can you try to delete the "" in your body if it can help?

    media_data=iVBORw.........II

     

    Best Regards,

    Yueyun Zhang

     

     

     

  • scales23456 Profile Picture
    9 on at

    No, unfortunately not. I've tried all combinations i could think of but they didn't work either.

     

    "key":"value"

    "key":value

    key:value

    key:"value"

    "key"="value"

    "key"=value

    key=value

    key="value"

     

    To date, the only place i can get it working is in the build in postman x-www-form-urlencoded body tab. Which confirms the API is working ultimately, but i presume there is some different formatting within there that i don't know. 

  • Jakeapril Profile Picture
    33 on at
    scales23456's response worked for me! Had to change my Content-Type to application/x-www-form-urlencoded and in my body, have "'Key'='Value'". Thank you!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard