0

I am trying to send a request in curl and trying to insert current timestamp in the cookie

curl -v 'https://example.com'
-H $'cookie: ts=1601356520581'

How to insert the date +%s%3N in place of the hardcoded value?

1 Answer 1

1

If you are using a POSIX shell (sh, bash, zsh, etc), you can expand your command with the syntaxis $(command). For example:

curl -v "https://example.com" -H "cookie: ts=$(date +%s%3N)"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.