msaz87 Posted July 22, 2013 Share Posted July 22, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/280404-curl-like-function-for-javascript/ Share on other sites More sharing options...
.josh Posted July 22, 2013 Share Posted July 22, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/280404-curl-like-function-for-javascript/#findComment-1441718 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.