Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var URL = "https://realla.co/api/v1/listings/search";
- var usr = 'api';
- var psw = 'hidden';
- $.ajax({
- type: "POST",
- dataType: "json",
- contentType: "application/json",
- url: URL,
- crossDomain: true,
- beforeSend: function(xhr) {
- xhr.setRequestHeader("Authorization", "Basic " + btoa(usr + ":" + psw))
- },
- success: function(result) {
- console.log('success');
- },
- error: function(req, status, err) {
- console.log('Something went wrong', status, err);
- }
- });
- XMLHttpRequest cannot load https://realla.co/api/v1/listings/search. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://dw.dev' is therefore not allowed access. The response had HTTP status code 403.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement