How to PARSE Sent Header?

The site I am testing is sensitive about the Content-Length header, unless it is the correct value and in lower case (content-length) it will always return a 401 error, so I need to PARSE the sent header to get the correct value. What do I put in PARSE input to do this?

It’s not in received headers like this?
Content-Length: 10765

In this case:

BLOCK:Parse
input = @data.HEADERS
leftDelim = ", (Content-Length, "
rightDelim = “)}”
MODE:LR
=> VAR @CoontentLenght
ENDBLOCK

Result :

Parse (ParseBetweenStrings) <<

Parsed value: 10765

Assigned value to variable ‘CoontentLenght’

Look here : http://localhost:5000/docs/lolicode/data_variable

Yes that is to parse the response headers, I need to parse the sent headers

Content-Length value is Length of “content-data” in your post request and it’s automacally calculated by OB2.
You don’t need to calculate or capture it.

The reason i’m trying to capture it is because OB2 default sent header is “Content-Length” I need it to be uncaptilized like “content-length” otherwise the site will throw an error.

You can manually calculate the length and set that header manually in the custom headers, OB2 will preserve it, but it needs to be the exact length of the content you are sending.

1 Like

Can you give example of how to manually calculate the length?

Nevermind, I got it. Create Constant String block, enter your payload then Create Length block, input the Constant String output to get content-length