OpenText Rest Api Error
Error : Access to XMLHttpRequest at 'http:///api/v1/auth' from origin 'http://localhost:3002' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
While calling OpenText Rest Api throwing above error using below code :
var otcsticket = '';
$.ajax({
// Authenticate is a POST
type: "POST",
url: "http:///api/v1/auth",
data: { username: "user", password: "password" },
beforeSend: function (xhr) {
// Set the correct MimeType for the request.
xhr.overrideMimeType("application/x-www-form-urlencoded")
}
}).done(function (data) {
var val = JSON.parse(data);
alert("setting otcsticket to: " + val["ticket"]);
// Store the ticket for later use.
otcsticket = val["ticket"];
}).fail( function( error ) {
console.log(error)
alert("Bad thing happened! " + error.statusText);
});
- Any suggestion
- Any server end setting to allow CORS ?
Leave a Comment
Categories
- All Categories
- Cloud Editions
- 1 Thrust Services
- cat as link
- 1 Core SaaS Application development
- 10 Developer Announcements
- 15 General Questions
- 33.4K TeamSite
- 141 Application Governance & Archiving
- 15.2K Designing Analytics Reports
- 1K DevShare Downloads
- Core SaaS Applications
- nested parent
- 4.3K Developing Analytics Applications
- 8.8K Documentum Developer Forum
- Media Management developer
- 159 Transactional Content Processing (TCP)
- 1.7K Web Experience Management
- 55 Tempo Social
- 1 XM Fax