Cómo enviar datos a un servicio web en otro dominio

I need to send data using javascript or jquery to a web service located on another domain. I know how to do this using JSONP and Http GET for the web service. But this means all data must be passed in the url. In my case, the data can be a few KB or more so it does not work all the time. I think i need to use HTTP POST instead.

Can anyone give me an example on how to get this done? Can I use JQuery post() method for cross domain?

preguntado el 28 de agosto de 11 a las 03:08

1 Respuestas

jQuery POST for another domain is not legal, and not so-allowed.

The best way would be passing the POST data to a 'bridge-script' on your own domain using jQuwry, where that script will transparently post the data using cURL.

cURL of course can 'forge' the posting/referring domain so that it appears legal.

Google it, I'm not sure if we are allowed to post such answers ;)

Enlace útil:

respondido 20 mar '17, 13:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.