Created
March 31, 2016 18:15
-
-
Save reganstarr/eebfe210892f50ffee9268e9afd9ef30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var apiUrl = 'ENTER_THE_API_URL_HERE'; | |
var data = JSON.stringify({ | |
"key1": "value1", | |
"key2": "value2" | |
}); | |
fetch(apiUrl, { | |
method: 'POST', | |
body: data, | |
headers: { | |
'Content-Type': 'application/json' | |
} | |
}) | |
.then(function(res) { | |
return res.json(); // You might need to change this to res.text() depending on what type of response you expect. | |
}) | |
.then(function(body) { | |
var output = body; // This must be a single object or an array of objects | |
callback(null, output); | |
}) | |
.catch(callback); |
hi @reganstarr thanks alot ... I want to send a photo file (fetching from my google drive) in multipart-form/data with that HTTP API request... would you plz help me how to change this code to do that ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @strages. Are you referring to Trello cards?
This should be possible within 1 code zapier step. I would probably use the "schedule by zapier" app to kick the whole thing off.