Maven2 vs. MS Power Automate

Hi all,

for an upload job via MS PowerAutomate i need to find the approriate JSON-syntax to upload maven2 components.
From what I undersatnd, this should be possible and I already read tons of articles found in differents communities.
This is what i have so far:

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

I assume that this is somehow correct, however it doesn’t work either via Postman or via MS PowerAutomate.
Error: Bad Request

any Ideas ?

Got it !!!

the reference:

And this is how it must look like in the HTTP connector/body in MS Power Automate:

{
“$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.