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 / cannot "transform" a w...
Power Automate
Unanswered

cannot "transform" a working cURL command for HTTP connector

(0) ShareShare
ReportReport
Posted on by 78

Hello all,

 

i wanto to use a  Flow to upload a file via REST.

when sending the corresponding command as cURL it works fine.

However, when importing the cURL into Postman (which is my blueprint for the HTTP connector) and trying from there, it fails with "unsupported media type".

I worked the last 3 days through all results Google shows me when searching for this or related error.

 

p.s. 

 

cURL command: 

curl -v -u <user:pass> -X POST "https://<url>/service/rest/v1/components?repository=<name>" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "maven2.groupId=1" -F "maven2.artifactId=1" -F "maven2.version=1" -F "maven2.asset1=@D:<path>\<file>;type=application/pdf" -F "maven2.asset1.extension=pdf"

 

(yes, its a Maven2 Repo @ Sonatype Nexus)

 

--> this works fine

 

However, i'm unable to format the HTTP connector in a way to make it work also via PowerAutomate

 

Ideas ?

 

Categories:
I have the same question (0)
  • murshed Profile Picture
    Microsoft Employee on at

    Hi @artivo 

    Unsupported media type usually indicates the media you are sending or receiving thru the HTTP connector. Can you please post the screenshot of the connector configuration you are using and the client request id from the error?

  • artivo36 Profile Picture
    78 on at

    Hi,

     

    i was trying around a lot.

    This is a screenshot from the last trial:

     

    artivo_0-1618310620302.png

     

    The error is alwas the same: "Unsupported Media Type"

     

    Not sure what you mean with client request id.

    Does this help:

     

    artivo_1-1618310941560.png

     

    From my understanding, this error comes from the destination-server / Sonatype Nexus.

    Assuming their docu is correct they should be able to deal with JSON.

    If so, i'm "simply" missing the right syntax.

     

  • artivo36 Profile Picture
    78 on at

    Got it !!!

     

    1st, the reference:

    https://powerusers.microsoft.com/t5/Building-Flows/HTTP-Post-multipart-form-data/td-p/145181powerusers.microsoft.com – 10 Aug 18

     


    And this is how the body snippet must look like to make it work with Sonatype (Nexus Repository Manager).


    {
    “$content-type”: “multipart/form-data”,
    “$multipart”:
    [
    {
    “headers”:
    {
    “Content-Disposition”: “form-data; name=“maven2.groupId””
    },
    “body”: “1”
    },
    {
    “headers”:
    {
    “Content-Disposition”: “form-data; name=“maven2.artifactId””
    },
    “body”: “1”
    },
    {
    “headers”:
    {
    “Content-Disposition”: “form-data; name=“maven2.version””
    },
    “body”: “12”
    },
    {
    “headers”:
    {
    “Content-Disposition”: "form-data; name=“maven2.asset1”;filename=“test.txt”
    },
    “body”: “SGVsbG8gV29ybGQ=”
    },
    {
    “headers”:
    {
    “Content-Disposition”: “form-data; name=“maven2.asset1.extension””
    },
    “body”: “txt”
    }
    ]
    }

    You can edit the values for the IDs to whatever you want or, what i am doing, connect them with values coming from a MS Forms document.
    In this example, the value for the asset is a base64 encoded text (“Hello World”).
    This is also intended to be connected to a file uploaded via MS Forms.

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 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard