This issue is mostly to pitch an idea.
When Hurl successfully executes it returns the content from whatever API/webpage it was called against it returns the raw content. We can extract the Content-Type from Hurl by running it with the -i flag.
With the Content-Type in hand it should be possible to set the buffer's filetype to the output Content-Type. As a note Hurl returns the last http request's content and headers only, so if you had multiple GET or POST requests in a single file to different URLs, only the last request's content is returned.
If Hurl runs into an error then we can return the content in stderr as usual without any filetype settings.
This issue is mostly to pitch an idea.
When Hurl successfully executes it returns the content from whatever API/webpage it was called against it returns the raw content. We can extract the
Content-Typefrom Hurl by running it with the-iflag.With the
Content-Typein hand it should be possible to set the buffer'sfiletypeto the outputContent-Type. As a note Hurl returns the last http request's content and headers only, so if you had multipleGETorPOSTrequests in a single file to different URLs, only the last request's content is returned.If Hurl runs into an error then we can return the content in
stderras usual without anyfiletypesettings.