Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gigamike's avatar

AWS API GetExport Download Stream

Guys,

Maybe you can help me, I'm using this AWS API https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-apigateway-2015-07-09.html#getexport. Sample response below. How I can download the response file swagger_2022-05-25T01:31:26Z.json

Aws\Result Object ( [data:Aws\Result:private] => Array ( [body] => GuzzleHttp\Psr7\Stream Object ( [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #305 [size:GuzzleHttp\Psr7\Stream:private] => [seekable:GuzzleHttp\Psr7\Stream:private] => 1 [readable:GuzzleHttp\Psr7\Stream:private] => 1 [writable:GuzzleHttp\Psr7\Stream:private] => 1 [uri:GuzzleHttp\Psr7\Stream:private] => php://temp [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array ( )

            )

        [contentType] => application/octet-stream
        [contentDisposition] => attachment; filename="swagger_2022-05-25T01:31:26Z.json"
        [@metadata] => Array
            (
                [statusCode] => 200
                [effectiveUri] => https://apigateway.ap-southeast-2.amazonaws.com/restapis/11111111/stages/dev/exports/swagger
                [headers] => Array
                    (
                        [date] => Fri, 27 Jan 2023 06:40:45 GMT
                        [content-type] => application/octet-stream
                        [content-length] => 189808
                        [connection] => keep-alive
                        [x-amzn-requestid] => xxxxx-1111-2222-3333
                        [content-disposition] => attachment; filename="swagger_2022-05-25T01:31:26Z.json"
                        [x-amz-apigw-id] =>abcsdeff=
                    )

                [transferStats] => Array
                    (
                        [http] => Array
                            (
                                [0] => Array
                                    (
                                    )

                            )

                    )

            )

    )

[monitoringEvents:Aws\Result:private] => Array
    (
    )

)

Thanks in advance

0 likes
1 reply

Please or to participate in this conversation.