• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HTTP POST with extendScript

Participant ,
Sep 20, 2019 Sep 20, 2019

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

TOPICS
Scripting

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2019 Sep 21, 2019

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: 'example.com/',

   headers: {'Accept': 'application/json','Content-Type': 'application/json'} });

alert(data.payload);

 

Look into post requests for uploading files.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 22, 2019 Sep 22, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 26, 2019 Sep 26, 2019

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

LATEST

I'm trying to send a post request with this library but it's not working with no errors. any updates for 2021?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines