jemand anders
Erfahrenes Mitglied
Hallo,
während ein Update, das ich machen will, auf der Konsole mit CURL klappt, komme ich im Browser mit JS nicht weiter. Statt einer Erfolgsmeldung (JSON zig Werten) erscheint immer
Gerade sah ich nun, dass offenbar aus der in jQueryAjax Methode PUT ein GET wird im Browser, bei Firefox und Chrome (Request Method: GET).
Konsole:
Browser:
Jemand eine Idee?
Grüße
während ein Update, das ich machen will, auf der Konsole mit CURL klappt, komme ich im Browser mit JS nicht weiter. Statt einer Erfolgsmeldung (JSON zig Werten) erscheint immer
Code:
{
message: "Not Found",
documentation_url: "https://developer.github.com/v3"
}
Gerade sah ich nun, dass offenbar aus der in jQueryAjax Methode PUT ein GET wird im Browser, bei Firefox und Chrome (Request Method: GET).
Konsole:
Code:
curl -X PUT -g 'https://api.github.com/repos/USER/REPO/contents/PATH/FILE.json?access_token=TOKEN' -d '{
"message": "update from api",
"committer": {
"name": "USER",
"email": "USER@MAIL.com"
},
"content": "xyz", // => format base64
"sha": "abc",
"branch": "gh-pages"
}'
Code:
$.ajax({
url: "https://api.github.com/repos/USER/REPO/contents/PATH/FILE.json?access_token=TOKEN",
contentType: "application/json",
dataType: "jsonp",
type: "PUT",
data: jsonData, // => object; content format base64
success: function (data) {
console.log(data.data);
},
error: function (error) {
console.log(error);
}
});
Jemand eine Idee?
Grüße