Author Topic: Javascript http request  (Read 535 times)

rukavinamilan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Javascript http request
« on: March 16, 2018, 01:35:43 PM »
I was reading docs but I cannot find a way to make http request from javascript (fetch api)? Or at least call from javascript shell (curl) to do so?

Thanks

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 189
    • View Profile
Re: Javascript http request
« Reply #1 on: March 20, 2018, 06:34:36 AM »
Hi,

You can't do the actual call from javascript because javascript is embedded in Yate, and yate doesn't have http support. What you can do is have an external php script, with a handler for a custom message. Ex: http.request. Send the message from javascript and let the php scrit do the call.

rukavinamilan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Javascript http request
« Reply #2 on: March 29, 2018, 11:22:32 AM »
Thanks Monica!
I'm aware of that option, but that's seems suboptimal, since javascript seems to work fast since it does not depend on external module...being able to make http request or shell exec would make it very flexible.

Thanks!

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 47
    • View Profile
Re: Javascript http request
« Reply #3 on: April 03, 2018, 01:25:48 PM »
The javascript interpreter is custom build, so it lacks lots of functionality that e.g. V8 would offer, because it was specifically for use with yate.