投递到Facebook墙上传统的ASP [英] Post to facebook wall with classic ASP
问题描述
我有一个问题发布到Facebook涂鸦墙与传统的ASP。变量fbName,fbUserID,的accessToken在现实生活设置 - 我只是删除了它在这里。我有正确的权限张贴到墙上的用户(publish_stream)。
该职位是不是贴在用户的Facebook涂鸦墙。难道我犯任何错误?
fbName =
fbUserID =
的accessToken =strURL =https://graph.facebook.com/与& fbUserID&安培; /饲料
strMessage = fbName&安培; 只是做了什么。
strLink =http://www.orf.at/
strAccessToken =的accessToken第=&AMP的access_token =?; strAccessToken&安培; &放大器;消息=&放大器; strMessage&安培; &放大器;链接=&放大器; strLink集xmlDoc中=的CreateObject(MSXML2.DOMDocument)
xmlDoc.async = FALSE
xmlDoc.setPropertyServerHTT prequest,真
bLoaded = xmlDoc.load(strURL&安培;对)
我很抱歉,我不能回答我的问题。但这里是正确的解决办法:
正确的答案是:
暗淡XMLHTTP
昏暗的资源设置XMLHTTP =的CreateObject(MSXML2.ServerXMLHTTP)
xmlHttp.OpenPOST,strURL&安培;对假
xmlHttp.setRequestHeader内容类型,应用程序/ x-WWW的形式urlen codeD
xmlHttp.send
要获取一些错误:
解析度= xmlHttp.responseText
的Response.WriteRES:&放大器;资源和放大器; < BR>中
的Response.Write状态:&放大器; xmlHttp.Status&安培; < BR>中
它看起来就像你没有使用HTTP POST请求。你需要像这样(未经测试)
暗淡XMLHTTP
设置XMLHTTP =的CreateObject(Microsoft.xmlHttp)
xmlHttp.OpenPOST,strURL&安培;第
xmlHttp.setRequestHeader内容类型,应用程序/ x-WWW的形式urlen codeD
xmlHttp.setRequestHeader的Content-Length,LEN(送出数据)xmlHttp.send昏暗的响应
响应= xmlHttp.responseText
I have a problem posting to facebook wall with classic asp. The variables fbName, fbUserID, accessToken are set in "real life" - i just deleted it here. I have the correct permissions for posting to a users wall ("publish_stream").
The post is not posted on the facebook wall of the user. Did I make any mistakes?
fbName = ""
fbUserID = ""
accessToken = ""
strURL = "https://graph.facebook.com/" & fbUserID & "/feed"
strMessage = fbName & " just did something."
strLink = "http://www.orf.at/"
strAccessToken = accessToken
para = "?access_token=" & strAccessToken & "&message=" & strMessage & "&link=" & strLink
set xmlDoc = createObject("MSXML2.DOMDocument")
xmlDoc.async = False
xmlDoc.setProperty "ServerHTTPRequest", true
bLoaded = xmlDoc.load(strURL & para)
i am sorry, i can't answer my own question. But here is the correct solution:
The correct answer is:
Dim xmlHttp
Dim res
set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlHttp.Open "POST", strURL & para, false
xmlHttp.setRequestHeader "Content-type","application/x-www-form-urlencoded"
xmlHttp.send
To fetch some errors:
res = xmlHttp.responseText
Response.Write "res: " & res & "<br>"
Response.Write "Status: " & xmlHttp.Status & "<br>"
It looks like you're not using a Http Post request. You need something like this(untested)
Dim xmlHttp
set xmlHttp = CreateObject("Microsoft.xmlHttp")
xmlHttp.Open "POST", strURL & para
xmlHttp.setRequestHeader "Content-type","application/x-www-form-urlencoded"
xmlHttp.setRequestHeader "Content-Length",len(sendData)
xmlHttp.send
Dim response
response = xmlHttp.responseText
这篇关于投递到Facebook墙上传统的ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!