Products Technologies Demo Docs Blog Support Company

ReportingCloud Web API Supports Now Cross Origin Resource Sharing (CORS)

The ReportingCloud API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. You can learn more about the CORS W3C recommendation here: https://www.w3.org/TR/cors/ Traditionally, AJAX requests have been restricted by the Same Origin Policy that only allowed them to make request to resources within the same domain. Since HTML5, this restriction is gone and allows for AJAX requests to be made across domains. The following is a sample CURL request from a browser…

ReportingCloud Web API Supports Now Cross Origin Resource Sharing (CORS)

The ReportingCloud API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. You can learn more about the CORS W3C recommendation here:

https://www.w3.org/TR/cors/

Traditionally, AJAX requests have been restricted by the Same Origin Policy that only allowed them to make request to resources within the same domain. Since HTML5, this restriction is gone and allows for AJAX requests to be made across domains.

The following is a sample CURL request from a browser hitting http://example.com:

curl -u username:password -i https://api.reporting.cloud/v1/account/settings -H "Origin: http://example.com"
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
Access-Control-Allow-Origin: *
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 26 Sep 2016 15:45:38 GMT
Content-Length: 157

This enables client-side languages such as JavaScript or jQuery to make ReportingCloud Web API calls. With CORS supported by ReportingCloud, you can make AJAX requests like any other AJAX call. The following sample calls the Account/Settings endpoint using jQuery:

var serviceURL =
    "https://api.reporting.cloud/v1/account/settings";

$.ajax
({
    type: "GET",
    url: serviceURL,
    dataType: "json",
    async: false,
    cache: false,
    headers: {
        "Authorization": "Basic " + btoa("username:password")
    },
    success: function(response) {
        console.log(response);
}
});

Happy coding!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

ASP.NETASP.NET CoreConference

The Mountains are Calling! Meet Text Control at TechBash 2025

Join us at TechBash 2025 in the beautiful Pocono Mountains, PA, from November 4-7. Discover how Text Control can enhance your applications with advanced document processing capabilities. Don't…


ASP.NETASP.NET CoreConference

Meet Text Control at DDC 2025 in Cologne

Join us at the .NET Developer Conference (DDC) 2025 in Cologne from November 24-27. Visit our booth to explore the latest in document generation and reporting with Text Control's DS Server and…


ASP.NETBASTA!Conference

Impressions from BASTA! 2025 in Mainz

We exhibited at BASTA! in Mainz, where we reconnected with clients, gathered valuable feedback, and showcased our latest innovations, including Markdown support for seamless conversion between…


ASP.NETASP.NET CoreConference

Text Control at NDC Copenhagen Developers Festival 2025

Last week, Text Control participated in the NDC Copenhagen Developers Festival 2025, a leading event for software developers and IT professionals in Scandinavia. We showcased our latest…


ASP.NETBASTA!Conference

Text Control Sponsors and Exhibits at BASTA! 2025 in Mainz

Text Control is proud to be a sponsor and exhibitor at BASTA! 2025 in Mainz, demonstrating our dedication to innovation and excellence in software development. Visit our booth to learn more about…