diff --git a/website/src/components/ApiRequest.jsx b/website/src/components/ApiRequest.jsx index 057a5e3905..2cc89aebfa 100644 --- a/website/src/components/ApiRequest.jsx +++ b/website/src/components/ApiRequest.jsx @@ -18,19 +18,31 @@ import CodeBlock from '@theme/CodeBlock'; const indentation = 2; const Component = ({ verb, payload, url, title }) => { - const verbUpper = verb?.toUpperCase() || "" - const prettyPayload = JSON.stringify(payload, null, indentation) + const verbUpper = verb?.toUpperCase() || ''; + const prettyPayload = JSON.stringify(payload, null, indentation); return ( - {`${verbUpper} /${url} + {` +${verbUpper} /${url} Authorization: content-type: application/json ${prettyPayload} -`} +`.trim()} + + + + + {` +curl -H "Content-Type: application/json" \\ + -H "Authorization: " \\ + -X ${verbUpper} + -d '${prettyPayload}' \\ + /${url} +`.trim()} @@ -38,7 +50,7 @@ ${prettyPayload} {`echo '${prettyPayload}' \\ | http ${verbUpper} \\ /${url} \\ - Authorization:`} + Authorization:`.trim()}