How can I translate this cURL request to a Parse.Cloud.httpRequest
?
curl --request POST \
--url https://api.thehive.ai/api/v2/task/sync \
--header 'accept: application/json' \
--header 'authorization: token <API_KEY>' \
--form 'url=http://hive-public.s3.amazonaws.com/demo_request/gun1.jpg'
I tried this but it throws an error;
Parse.Cloud.httpRequest({
method: "POST",
url: "https://api.thehive.ai/api/v2/task/sync",
headers: {
authorization: `token ${visualModerationToken}`,
accept: "application/json"
},
params: {
url: "http://hive-public.s3.amazonaws.com/demo_request/gun1.jpg"
},
success: function(httpResponse) {
},
error: function(error) {
}
})
I’ve also tried this;
Parse.Cloud.httpRequest({
method: "POST",
url: "https://api.thehive.ai/api/v2/task/sync",
headers: {
authorization: `token ${visualModerationToken}`,
accept: "application/json"
},
body: {
form: {
url: "http://hive-public.s3.amazonaws.com/demo_request/gun1.jpg"
}
},
success: function(httpResponse) {
},
error: function(error) {
}
})
The issue is with how I pass the url
parameter. Any ideas?