Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow response headers to be changed #3495

Open
1 task done
drwelby opened this issue Nov 15, 2024 · 1 comment
Open
1 task done

Allow response headers to be changed #3495

drwelby opened this issue Nov 15, 2024 · 1 comment
Labels
enhancement New feature or request module-qol

Comments

@drwelby
Copy link

drwelby commented Nov 15, 2024

I have checked the following:

  • I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

In #2441 the request body could be updated. This is useful to convert less human-friendly response bodies into structures that are more legible.

However, since it appears the application relies on the content-type header to determine how to display the result, this mean that while it is possible to convert the response between formats, the contents will only render as the original format.

A common use case is with APIs that return a response in the GeoJSON format. This standard represents spatial objects like polygons and points on a map. It is helpful to be able to see the results as a map instead of as a string of characters.

An example of this in Postman is https://github.com/OrdnanceSurvey/postmanGeoJSON. The GeoJSON response body is inserted into HTML code to be rendered in the response.

Bruno can render similar content in the response correctly already - a GET request of https://leafletjs.com/examples/quick-start/example.html works fine in the "web" preview in the response panel.

Mockups or Images of the feature

The following functions would be exposed in responses, following the same syntax for requests:

res.setHeader()
res.setHeaders()

This would look like (skipping the HTML generation code):

Screenshot 2024-11-15 at 11 40 30 AM
@drwelby
Copy link
Author

drwelby commented Nov 21, 2024

The additional functions seemed straightforward to add so I created a PR: #3527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module-qol
Projects
None yet
Development

No branches or pull requests

2 participants