Can someone tell me how I can go about converting this curl code listed below to $http.post() for angular js? Any help would be much appreciated. Thanks!
curl https://example.zendesk.com/api/v2/organizations.json \
-H "Content-Type: application/json" \
-d '{"organization": {"name": "My Organization"}}' \
-v -u {email_address}/token:{api_token}
So far I have the following angularjs code set up:
$http({
method : "POST",
url : url,
data : angular.toJson($scope.form),
headers : {
'Content-Type' : 'application/json'
}
}).then(Success,Failure);
I just have no idea how to setup the email address and token with the call.
$http.post()?