طلب POST بصيغة JSON
الإدخال
curl -X POST "https://api.example.com/orders" -H "Content-Type: application/json" -d '{"sku":"A100","qty":2}'الإخراج
method: "post", data: "{\"sku\":\"A100\",\"qty\":2}"AppHelp
حوّل أمر cURL إلى كود Axios يتضمن الرابط والطريقة والترويسات وجسم الطلب. التحويل محلي ولا يرسل أي طلب.
import axios from "axios";
const response = await axios({
url: "https://api.example.com/orders",
method: "post",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN"
},
data: "{\"sku\":\"A100\",\"qty\":2}"
});حوّل أمر cURL إلى كود Axios يتضمن الرابط والطريقة والترويسات وجسم الطلب. التحويل محلي ولا يرسل أي طلب.
curl -X POST "https://api.example.com/orders" -H "Content-Type: application/json" -d '{"sku":"A100","qty":2}'method: "post", data: "{\"sku\":\"A100\",\"qty\":2}"