Jump to content

cURL-like function for javascript?


msaz87

Recommended Posts

Is there any cURL-like function in javascript or only HTML that can post data to an external URL? I've used cURL to achieve this with PHP, but now I'm dealing with a form that's submitted and I want to be able to post some of the submitted fields to an external URL.

Link to comment
Share on other sites

AJAX is the current "closest to" equivalent.  However, you cannot make a request to an external URL unless the target server is specifically setup to allow cross domain requests.  

 

There's also web sockets, but it's still (kinda) new, and would also require the target server to be setup for it. 

 

So basically there is currently no way to use javascript to make an unsolicited request to an external domain, and this by design for security reasons.  

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.