0
我試圖從Amazon S3 AWS中使用lambda函數/ javascript獲取來自Netatmo雲的weatherdata的JSON響應。 我第一次嘗試使用以下方法獲取令牌。看來美元符號不被認可。是什麼賦予了?使用Lambda函數在Amazon S3中發出Ajax請求
function getNetatmoData(){
var clientId = "******";
var clientSecret = "******";
var userId="******@******.com";
var parola="******";
var formUserPass = { client_id: clientId,
client_secret: clientSecret,
username: userId,
password: parola,
scope: 'read_station',
grant_type: 'password' };
$.ajax({
async: false,
url: "https://api.netatmo.net/oauth2/token",
type: "POST",
dataType: "json",
data: formUserPass,
success: function(token){
// do something awesome with the token..
}
});
console.log("http request successful...");
}
感謝您的意見!將嘗試並找回你! –