2016-12-15 188 views

回答

0

这有什么好做的jQuery。这意味着服务器不想回应,因为您没有在URL中提供正确的凭据,或出于其他原因。 401只是表示:您无权访问此网页。

0

尝试添加正确的标题,并设置withCredentials TRUE在xhrFields:

jQuery.ajax({ 
     url: 'https://tp.grandoption.com/graph/get-option-feed?resolution=raw&assetId=EURUSD&optionId=e731c860-949b-11e6-9c5b-005056911347&accountId=anonymous', 
     headers: { 
      "Accept" : "application/json; charset=utf-8", 
      "Content-Type": "application/json; charset=utf-8" 
     }, 
     xhrFields: { withCredentials: true } 
    })