# Send Byte array using Invoke-RestMethod

**URL:** <https://forums.powershell.org/t/send-byte-array-using-invoke-restmethod/14631>\
**Category:** PowerShell Help\
**Created:** [July 5, 2020, 12:55pm UTC](https://forums.powershell.org/t/send-byte-array-using-invoke-restmethod/14631 "2020-07-05T12:55:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phatmandrake](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/phatmandrake/32/1001_2.png) [@phatmandrake](https://forums.powershell.org/u/phatmandrake)\
**Post date:** [July 5, 2020, 12:55pm UTC](https://forums.powershell.org/t/send-byte-array-using-invoke-restmethod/14631/1 "2020-07-05T12:55:03Z")

</div>

Is it possible to pass along a byte array as apart of a post request using `Invoke-RestMethod`?

I have a Byte Array in memory that I want to send along using the `-Form` parameter of `Invoke-RestMethod` (PS7). The alternative is to save it to disk (which I want to avoid) first, then use `Get-Item` to return an object of [System.IO.FileInfo], which `Invoke-RestMethod` automatically processes and submits the binary data, how would you do this manually?

---

<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:29pm UTC](https://forums.powershell.org/t/send-byte-array-using-invoke-restmethod/14631/2 "2024-05-16T20:29:35Z")

</div>

Closed on May 16, 2024, 8:29pm UTC


