1

Is there a way to format a HTTP request like this, like when using http with markdown?

PATCH /v1/something/1234 HTTP/1.1
Host: somehost.com
Content-Type: application/json
Accept: application/json
Api-Key: supersecretkey
Content-Length: 107

{ "date": "2023-03-15 05:39", "status": 0 }

Juliana
  • 111

1 Answers1

1

You could use the package minted. Pygemtize supports the lexer http. You could check this with: pygmentize -L lexers.

\usepackage{minted}

\begin{minted}{http} PATCH /v1/something/1234 HTTP/1.1 Host: somehost.com Content-Type: application/json Accept: application/json Api-Key: supersecretkey Content-Length: 107 \end{minted}

\begin{minted}[]{js} { "date": "2023-03-15 05:39", "status": 0 } \end{minted}

ikreb
  • 491