how to assign a variable the value I get from curl -w $ {http_code}
please help with this question.
I have a request
curl -v -w% {http_code} --location --request POST $ HOST_1C \
--header 'x-auth-token: "token"' \
--header 'Content-Type: application / json' \
--data-raw '{
"order_id": '$ order_val',
"type": "reserve",
"warehouse_id": '$ wh_val',
"products": [
{
"product_id": 716,
"count": 1
}
]
} '
echo 'case # ???: Warehouse =' $ wh_val ', Order =' $ order_val ', Count = ??, Type = reserv \ non-reserv, Serverrespons (ER: AR) ='% {http_code} ':? ?? '>> test_file.txt
sleep 1
I want to output the value
%{http_code}
to the line
echo 'bla-bla-bla ServerRespons (ER: AR) ='% {http_code} ': ???'
How can i do this?