A
A
animanshnik2021-01-02 20:03:00
bash
animanshnik, 2021-01-02 20:03:00

(CURL) How to send data value as a number?

You need to send a request to a specific service, but it requires a number as a value.
What if curl only sends strings?
I thought maybe it was because of the bash, because it has no types, but ((3600)) did not work either.
I can not influence the service in any way.
My request:

curl -X POST --http1.1 -H "authorization: Bearer $token" -d 'ipv4=195.140.146.94&subdomain='$need_dns'&ttl='$(($ttl))'&type=a' $url

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
animanshnik, 2021-01-02
@animanshnik

Problem solved, who needs a solution:

$(curl -X POST url -H "authorization: Bearer $token" -H "Content-Type: application/json" --data-binary @- <<DATA
{"ipv4": "195.140.146.94",
 "subdomain": $need_dns,
 "ttl": 3600,
 "type": "a"}

DATA
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question