A
A
AirFlare2021-07-08 17:25:23
bash
AirFlare, 2021-07-08 17:25:23

How to base64 encode request with cURL?

Good day. How to base64 encode request with cURL? There is the request itself:
curl -d "exmple=$1&log=$reslt" -X POST example.com
It needs to be encoded in base64: exmple=$1&log=$reslt. How can I do that.
PS: Googled, but found examples only with .img and text files.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-07-08
@AirFlare

curl -d `echo -n "exmple=$1&log=$reslt" | base64` -X POST example.com

S
Saboteur, 2021-07-12
@saboteur_kiev

curl -d $(base64<<<"exmple=$1&log=$reslt") -X POST example.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question