# Curl vs invoke-restmethod (with file upload)

**URL:** <https://forums.powershell.org/t/curl-vs-invoke-restmethod-with-file-upload/11669>\
**Category:** PowerShell Help\
**Created:** [November 14, 2018, 7:16am UTC](https://forums.powershell.org/t/curl-vs-invoke-restmethod-with-file-upload/11669 "2018-11-14T07:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbjh](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tbjh](https://forums.powershell.org/u/tbjh)\
**Post date:** [November 14, 2018, 7:16am UTC](https://forums.powershell.org/t/curl-vs-invoke-restmethod-with-file-upload/11669/1 "2018-11-14T07:16:05Z")

</div>

I have the following Curl Code, and would lige to convert it to pure powershell, using the invoke-restmethod command

curl.exe -l http://\<my server\>/masking/api/file-formats -H “content-type: multipart/form-data” -H “Authorization: cd3bc892-421c-482f-8b63-1131d806ebf1” --form fileFormat=@E:/Tools/Powershell/Delphix/FileFormats/BS\_REC00004\_CSV.FF --form fileFormatType=DELIMITED

How can that be converted to invoke-restmethod?

Anyone, any ideeas?

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)\
**Post date:** [November 14, 2018, 7:58am UTC](https://forums.powershell.org/t/curl-vs-invoke-restmethod-with-file-upload/11669/2 "2018-11-14T07:58:40Z")

</div>

You can refer to : [https://powershell.org/forums/topic/curl-to-invoke-restmethod-conversion/](https://powershell.org/forums/topic/curl-to-invoke-restmethod-conversion/)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:33pm UTC](https://forums.powershell.org/t/curl-vs-invoke-restmethod-with-file-upload/11669/3 "2024-05-16T20:33:43Z")

</div>


