jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
144 stars 13 forks source link

Improve HTTP output #55

Closed MartinKolarik closed 1 year ago

MartinKolarik commented 1 year ago

Instead of rawOutput, print rawHeaders to stderr and rawBody to stdout (see https://github.com/jsdelivr/globalping/issues/347 for explanation).

jimaek commented 1 year ago

By default we use head anyway so nothing will change in the output there, right? What do we show if the user specifies GET? Show headers and html? What the user needs to do to only get html?

MartinKolarik commented 1 year ago

For HEAD, nothing changes. For GET, you get the headers + body now. We could add an option to remove headers from the output, but I don't think it's necessary when it goes to the error stream.

didil commented 1 year ago

@MartinKolarik does this only need to be implemented for ci mode ? or also for the live mode ?

didil commented 1 year ago

also where do we write the result headers (example > EU, DE, Frankfurt, ASN:16276, OVH SAS)). To stderr or stdout ?

MartinKolarik commented 1 year ago

@MartinKolarik does this only need to be implemented for ci mode ? or also for the live mode ?

Always.

also where do we write the result headers (example > EU, DE, Frankfurt, ASN:16276, OVH SAS)). To stderr or stdout ?

err, I already opened a separate task for that as it applies to all commands #56

didil commented 1 year ago

@jimaek do these changes --full and rawBody vs rawOutput need to be implemented in the chatbot as well ?

jimaek commented 1 year ago

The output doesnt change right? We agreed that by default we use HEAD and show only headers, and get shows only HTML without headers. So it wouldn't hurt to add --full to match the CLI.

@MartinKolarik confirm please

MartinKolarik commented 1 year ago

@didil yes make chatbots match the CLI.