Skip to main content

Notifications

Community site session details
Power Automate - Power Automate Desktop
Answered

How to use invoke web service Request body formdata()?

Like (0) ShareShare
ReportReport
Posted on 27 Oct 2023 06:23:16 by 55

I want to upload a file using Request api.

 

I successfully tested it as a Postman program.
But I don't know how to use the invoke web service action in the power automate desktop.

Please refer to the setting method below.

 

[postman-Request]
let formData = new FormData();
formData.append("subject_id", ‘14’);
formData.append("uploader", el.files[0], el.files[0].name);
formData.append("id", ‘testmaster’);
formData.append("password", ‘testmaster00’);
 
fetch('http://testurl/', {
    method: 'POST',
    body: formData
})
.then((response) => response.json())
.then((data) => {
    console.log(data);
});

 

song_coach_0-1698386033467.pngsong_coach_1-1698386082995.png

 

I referred to the link below.
https://ashiqf.com/2021/07/25/how-to-use-form-data-and-form-urlencoded-content-type-in-power-automate-or-logic-apps-http-action/

 

[Result Error message]

HTTP Status 500 – Internal Server Error

Message
Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found

Description
The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found

  • song_coach Profile Picture
    55 on 24 Apr 2024 at 15:04:12
    Re: How to use invoke web service Request body formdata()?

    File upload api is not available with invoke web service action, refer to curl -x and test with rundos action.

  • Greggy11 Profile Picture
    4 on 24 Apr 2024 at 14:49:46
    Re: How to use invoke web service Request body formdata()?

    I want to upload a file using Request api.

     

    I already test this postman and its working great however when Im using the invoke web service in power automate desktop im getting this kind of error.: failed to extract params: id: error parsing form
    multipart: NextPart: EOF
    version: error parsing form
    multipart: NextPart: EOF

    This is my request body:

    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="id"

    27
    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="version"

    4
    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="file"; filename="test.txt"
    Content-Type: application/octet-stream

    VEVTVCBURVNUIFRFU1QgVEVTVCBURVNUIFRFU1QgVEVTVCBURVNU
    ------WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="name"

    text
    ------WebKitFormBoundary7MA4YWxkTrZu0gW--





    name: error parsing form
    multipart: NextPart: EOF





  • song_coach Profile Picture
    55 on 24 Apr 2024 at 14:41:54
    Re: How to use invoke web service Request body formdata()?

    Hello. I didn't understand the meaning of the question. What does query creation mean?

    I used curl to post the created api.

    The program was handled by CMD(Run DOS action).

  • Greggy11 Profile Picture
    4 on 24 Apr 2024 at 14:30:19
    Re: How to use invoke web service Request body formdata()?

    Hi, how did you generate the curl -X POST query? what application did you use?

  • Verified answer
    song_coach Profile Picture
    55 on 28 Oct 2023 at 17:33:26
    Re: How to use invoke web service Request body formdata()?

    I succeeded in uploading the file through the test.

    (I struggled with small quotes and big quotes.)
    Share the successful query below.

     

    curl -X POST %str_url% -H "Content-Type: multipart/form-data" -F "subject_id=%str_subject_id%" -F "id=%str_id%" -F "password=%str_pw%" -F "uploader=@%fileP_uploader%"


    Many people look forward to being helped.
    Thank you @Agnius 

  • song_coach Profile Picture
    55 on 27 Oct 2023 at 16:14:26
    Re: How to use invoke web service Request body formdata()?

    Hi, @Agnius
    Thank you always for your answer.

    I've tested it in many ways
    The conclusion was that the invoke web service had no file upload function, so it kept failing.

    Let's test the Run dos curl.
    Thank you.

    same question
    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Power-Automate-Desktop-Invoke-web-service-send-file/td-p/1872399

  • Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 27 Oct 2023 at 06:30:23
    Re: How to use invoke web service Request body formdata()?

    Try following this walkthrough: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Walkthrough-How-to-use-Invoke-Web-Service-with-multipart-form/m-p/981388

     

    It presumably doesn't really work too well with file uploads, but the comments under the post also include a description of how to do it via the Run DOS command action.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 18 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 10 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard