我正在使用 javascript API 将图片发布到 facebook
$.ajax({
type : "POST",
url : "https://graph.facebook.com/me/photos",
data : {
message : "Good One",
url : photoUrl,// URL of Image to post on facebook ,e.g https://si0.twimg.com/profile_images/2642324404/46d743534606515238a9a12cfb4b264a.jpeg
access_token : getCookie("fbTocken"),//this is the access tocken which i got frome facebook ,saved it in cookies which I am fetching
format : "json"
},
success : function(data) {
alert("POST SUCCESSFUL");
}
)}
一切正常,问题是当我改变
photourl
到本地主机图像网址,如http://localhost:8980/xcloud/resources/images/logo.png
脸书返回错误
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
其他正常的网址我可以发布到 facebook 并且工作正常
(项目在java中,tomcat作为服务器)