postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.82k stars 839 forks source link

Feature request: Support for streamed responses #5040

Closed jimonthebarn closed 6 months ago

jimonthebarn commented 6 years ago

With the advent of reactive streaming API's the handling of streamed responses becomes more and more important. Therefore I would love for postman to be able to handle streamed responses when setting the accept - header to application/stream+json or text/event-stream instead of the currently displayed 'Syntax error".

The response window could probably be updated when a new chunk of data comes in just like curl or httpie (with the --stream option) does. This probably needs a lot more thinking conceptually since it greatly differs from the way how responses are currently displayed in the response pane.

For the time being postman could wait for the stream to finish and output the result all at once just like httpie does when not started with the --stream parameter.

The alternative solution is currently to use curl or httpie which works but I'd love to be able to do this in my beloved postman. 😁

jimonthebarn commented 6 years ago

In the meanwhile we could probably update the "code" generated when creating a Shell httpie request to also contain the --stream parameter in case of streaming responses. Othwise httpie buffers the data and will only output it once the response is completely received.

spanitz commented 5 years ago

👍

zeesattarny commented 4 years ago

Is there any update on this? I am currently facing this issue and wanted to know if there is any work around to deal with streams in Postman response.

5thdimensional commented 4 years ago

I'm also looking for this capability for testing our streaming API with Postman alongside our other collections.

galen211 commented 4 years ago

This feature would be useful for interacting with ksqlDB, which has a REST API endpoint for streaming queries

matthenry87 commented 4 years ago

+1

amoswood commented 4 years ago

+1 as it would be useful for interacting with ksqlDB.

wuf810 commented 4 years ago

+1

alexrosenfeld10 commented 4 years ago

+1

zionitcorp commented 4 years ago

+1

OwainPrice commented 4 years ago

+1

imjohnking commented 4 years ago

+1

arramanenka commented 4 years ago

+1

SummerShoohaw commented 4 years ago

+1

gaerfield commented 4 years ago

As workaround some scripting helps. I inserted the script of this stackoverflow-answer as Pre-request Script. Within the GET-Adress-bar I used an arbitrary page (google, health-endpoint, doesn't matter). Because I was testing publish/subscribe, I triggered additionally some URLs within Tests. The Console logged everything.

Basic setup: image

Pre-request Script (https://stackoverflow.com/a/53934401/5029667):

// This timeout ensure that postman will not close the connection before completing async tasks.
//  - it must be cleared once all tasks are completed or it will hang
const interval = setTimeout(() => {}, Number.MAX_SAFE_INTEGER);

let promiseNumber = 0;

function resolvedPromise() {
    return new Promise((resolve, reject) => {
        pm.sendRequest('https://domain.tld/subscribeToUser/karl' (err, res) => {
            if (err) {
                console.log(err);
                reject();
            } else {
                console.log(`Resolved promise ${++promiseNumber}`);
                resolve();
            }
        });
    });
}

resolvedPromise()
    .then(resolvedPromise)
    .then(resolvedPromise)
    .then(() => clearTimeout(interval))
    .catch(err => {
        console.log(err);
        clearTimeout(interval);
    });

Optionally issue scripts in the Tests-tab:

pm.sendRequest("https://domain.tld/sendToUser/karl/whoopwhoop1", function (err, response) {});
pm.sendRequest("https://domain.tld/sendToUser/karl/whoopwhoop2", function (err, response) {});
pm.sendRequest("https://domain.tld/sendToUser/karl/whoopwhoop3", function (err, response) {});
vladimirov001 commented 3 years ago

+1

tyukesz commented 3 years ago

+1

akhill10 commented 3 years ago

+1

Zenegrad commented 3 years ago

+1

nithish-knetworks commented 3 years ago

+1

maxceem commented 3 years ago

+1

jomalla123 commented 3 years ago

+1

OmiWakode commented 3 years ago

+1

aquiporras commented 3 years ago

+1

SebaPrati commented 2 years ago

+1

deiansp commented 2 years ago

+1

felaray commented 2 years ago

+1

onigor commented 2 years ago

+1

cs12b015 commented 2 years ago

+1

marchy commented 2 years ago

What is the team's current roadmap priority on tackling this?

e-ilyasse commented 2 years ago

+1

shubham-solytics commented 2 years ago

+1

sronelpol commented 2 years ago

+1

mtache commented 2 years ago

+1

arekfajdek commented 2 years ago

+1

Murali-P commented 2 years ago

+1

cristinacamilolima commented 2 years ago

+1

neexs commented 2 years ago

+1

ziadsarour commented 2 years ago

+1

ex-tag commented 1 year ago

+1

ex-tag commented 1 year ago

Recommend cURL, to anyone that needs to test SSE, HTTP/1 chunked encoding, or HTTP/2 responses.

nathaniel-lehrer-ib commented 1 year ago

+1

hetthummar commented 1 year ago

+1

hu70258tao commented 1 year ago

+10086

sarfraaz-talat commented 1 year ago

+10087

RipVanTesla commented 1 year ago

+1

krishna-cactus commented 1 year ago

+1

jvdhehvg commented 1 year ago

+1

gaston-munoz commented 1 year ago

+1

nonlin commented 1 year ago

+1