HTTP POST with extendScript
Copy link to clipboard
Copied
Hi friends,
I wonder is there a way to upload an HTTP post to my server using extendScript?
And if so, is it also possible to upload a file (mp3 or mp4) to my server using the same method or do other tools like CURL have to be used?
Thank you
Copy link to clipboard
Copied
You can use the built-in Socket object in After Effects, but it's pretty complicated with hardly any documentation. Check out this library for making HTTP requests:
https://github.com/buraktamturk/adobe-javascript-http-client
Once you've included that library, making HTTP requests are pretty straightforward:
var data = $http({
method: 'GET',
url: 'http://example.com/test.json…',
headers: {'Accept': 'application/json','Content-Type': 'application/json'} });
alert(data.payload);
Look into post requests for uploading files.
Copy link to clipboard
Copied
Thanks for your answer! I now this library. And I know that you can upload text with the POST request, but i wonder it it pasible also to upload files?
Copy link to clipboard
Copied
I haven't done it myself, but it should be possible. This article should help:
https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL/FileGuide/FileUpDown
If not, you might want to look into streaming data with WebSockets.
Copy link to clipboard
Copied
I'm trying to send a post request with this library but it's not working with no errors. any updates for 2021?

