本文介绍了FB连接:(417)预期失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发了一个简单的ASP.NET应用程序,它工作正常,但现在我无法得到用户信息;我得到这个消息:
I developed a simple ASP.NET app, it was working fine, but now I can't get user info; I am getting this message:
远程服务器返回错误:(417)预期失败。
和这里的code我使用的是:
and here's the code I'm using:
Dim FBUser As Facebook.Schema.user = Nothing
Dim connectSession As Facebook.Session.ConnectSession
Dim FBApi As Api
connectSession = New Facebook.Session.ConnectSession(ConfigurationManager.AppSettings("AppKey"), ConfigurationManager.AppSettings("AppSecret"))
If connectSession.IsConnected() Then
FBApi = New Api(connectSession)
Try
FBUser = FBApi.Users.GetInfo()
'' do some work
Catch ex As Exception
FBUser = Nothing
'' other work
End Try
End If
这是真的很困惑,因为它只是工作罚款2周,现在!
This is really confusing, because it was just working fine for 2 weeks now !!
感谢
推荐答案
我张贴的解决方案,后期很抱歉,但它竟然是一些ISP相关的东西。添加此行web配置将帮助:
I'm sorry for posting the solution that late, but it turned out to be some ISP related stuff. Adding this line to web config will help:
<system.net>
<settings>
<servicePointManager expect100Continue="false"/>
</settings>
</system.net>
或者,它相当于由code。
Or it equivalent by code.
这篇关于FB连接:(417)预期失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!