<p><pre><code> # Capture the content-length header value
[[ "$line" =~ ^Content-Length:\ ([0-9]+) ]]
</code></pre>
Be forewarned that the space after any http header is optional <<a href="https://www.rfc-editor.org/rfc/rfc9112#name-field-syntax" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc9112#name-field-syntax</a>> so require it in your match at your peril. And, of course, http headers are case insenstiive so checking for the upper in <i>any</i> position is rolling the dice<p><pre><code> id=$(echo -E "$json_payload" | jq -r '.id')
</code></pre>
that answers my question about how "in Bash" was going to deal with all the json