I want to convert curl to javascript?
I want to change this code to java script and i don't have knowledge of http
curl -u username:password \
-H 'Content-Type: application/json' \
-H 'User-Agent: MyApp (yourname@example.com)' \
-d '{ "name": "My new project!" }' \
https://xxxxxx.com/999999999/api/v1/projects.json
to
var option = {
method: "get",
muteHttpExceptions: true,
headers: {
"Content-Type": "application/json",
"User-Agent": "MyApp (yourname@example.com)",
"username": "xxxxxx"
}
};
Thanks
No comments:
Post a Comment