Hello,
On Tue, 2017-05-16 at 05:40 -0700,
michaelb...@gmail.com wrote:
> So can you please clarify this for me before I continue developing my
> javascript client? Does this policy mean that javascript code on a
> web page running on IIS on the same physical machine as the Orthanc
> server can't use the Orthanc RESTful interface? Like so:
>
>
> $.ajax({
> url: "
http://localhost:8042/patients",
> method: 'GET',
> success:function(data) {
> $("#fromAjax").html(JSON.stringify(data, null,
> 2));
> }
> });
>
> Because it doesn't seem to work. Please let me know if this is the
> expected behavior.
This is the expected behavior if it is running on a different port (as
that counts as a different origin), but it is possible to instruct the
user agent (browser) to allow execution of code originating from
different origins than the main document using CORS[1] or simply by
proxying the requests through a single origin.
I encourage you to review some resources on CORS to understand its
mechanics. Once you've done so, the three approaches already outlined
by Sébastien should become very intuitive. They're also documented
here[2].
[1]
https://www.w3.org/TR/cors/ https://developer.mozilla.org/en-US/doc
s/Web/HTTP/Access_control_CORS
[2]
http://book.orthanc-server.com/faq/same-origin.html