# Invoke-RestMethod Returns Error Indicating Response Size Exceeds 6MB Limit

**URL:** <https://forums.powershell.org/t/invoke-restmethod-returns-error-indicating-response-size-exceeds-6mb-limit/20843>\
**Category:** PowerShell Help\
**Created:** [November 4, 2022, 5:32pm UTC](https://forums.powershell.org/t/invoke-restmethod-returns-error-indicating-response-size-exceeds-6mb-limit/20843 "2022-11-04T17:32:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doug\_Horton](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Doug\_Horton](https://forums.powershell.org/u/Doug_Horton)\
**Post date:** [November 4, 2022, 5:32pm UTC](https://forums.powershell.org/t/invoke-restmethod-returns-error-indicating-response-size-exceeds-6mb-limit/20843/1 "2022-11-04T17:32:24Z")

</div>

We have a data mart that has been ingesting large responses from an API server call using invoke-restmethod for 4 years without issue. Yesterday, we started seeing errors with error code 400 and message “Response exceeds maximum size (6 MB)”.

I tried using invoke-webrequest instead and get the same error. Postman calls using the same endpoint complete successfully.

I cannot seem to find any documentation on this limitation let alone anything that would help me determine how to increase this limitation.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [November 4, 2022, 10:14pm UTC](https://forums.powershell.org/t/invoke-restmethod-returns-error-indicating-response-size-exceeds-6mb-limit/20843/2 "2022-11-04T22:14:43Z")

</div>

OP posted that this is fixed on Spiceworks:

> **[Invoke-restmethod fails with "response exceeds maximum size (6MB)"](https://community.spiceworks.com/topic/2468138-invoke-restmethod-fails-with-response-exceeds-maximum-size-6mb?from_forum=356)**
>
> \[UPDATE - After more analysis, we believe the error verbiage is inaccurate causing us to look in the wrong areas. We believe it is actually a problem with the vendor's API serve...

---

<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:16pm UTC](https://forums.powershell.org/t/invoke-restmethod-returns-error-indicating-response-size-exceeds-6mb-limit/20843/3 "2024-05-16T20:16:24Z")

</div>

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


