web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate HTTP ac...
Power Automate
Suggested Answer

Power Automate HTTP action fails with "Error while copying content to a stream"

(1) ShareShare
ReportReport
Posted on by

We have a flow configured with the "When Power Apps calls a flow (V2)" trigger, which sends a POST request to an external service using the HTTP action.

The POST request is sent to external service whose purpose is to execute custom queries against a PostgreSQL database and return the results back to Power Automate, which then passes them to the Power Apps application. When using the HTTP action in Power Automate, the following error is returned in response to the POST request:

BadRequest
Http request failed as there is an error:
'Error while copying content to a stream.'

The request completes successfully when the response contains a very small dataset (approximately 15 records). However, the error occurs when the response contains a larger number of records.

We have been using this approach successfully for more than a year, and this issue only started occurring today.

Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Since:
    • The solution worked for over a year.
    • Small datasets still work.
    • Large datasets suddenly fail.
    The most likely causes are:
    • Response payload size has increased significantly (most likely).
    • Malformed/truncated JSON in one of the returned records.
    • Recent change in the external API or response encoding/compression.
    • Temporary issue/regression with the Power Automate HTTP connector.
    I would start by comparing a successful response and a failing response in Postman (size, headers, and JSON validity). That comparison usually identifies the root cause very quickly.
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @DK-04121105-0,
     

    We have a proven clue "the error occurs when the response contains a larger number of records." So, This error most commonly indicates that the HTTP network connection broke while the payload was actively transferring, or the payload size exceeded the platform's processing limits. Because it failed midway through streaming the data, the target server or application rejected the request as a BadRequest.

    1. Try turning off "Automatic decompression" in the HTTP action settings if it is on already.
    2. Optimize or paginate your query to reduce response size.  Check if the API supports pagination by returning a next page URL or token (e.g., @odata.nextLink or a nextPageToken).
    3. Verify headers and content types are correctly set.
    4. Test the API response in Postman and compare with Power Automate.
     One more point, we can do a filter early approach: let's shorten the uery boundaries. For instance, instead of pulling a month of log data, apply a tighter filter to pull only 1–7 days for example. Also, Run the Query in SQL and see if data returned by the SQL query is too large. Try reducing the dataset or applying filters as mentioned earlier.
     
    Referenfces:
    1. Time out handling
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard