Skip to content

"Copy as curl" button on HTTP code blocks #1302

@LeoMcA

Description

@LeoMcA

Navigating the HTTP docs while investigating what OPTIONS does (in the context of a CORS preflight request) made me want to be able to copy a request code block as a curl command so I could easily run it locally without having to construct it myself.

Implementation could be a little tricky - there would be a load of edge cases and we'd need some sort of allow-list to figure out which code blocks are requests rather than responses - but perhaps we could hard code a button on our most popular HTTP page as an experiment, and see how many people actually click on it.

That implementation could also be useful if we wanted to integrate with the devtools network panel (where you can craft requests in a GUI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions