I developed a simple ASP.NET app, it was working fine, but now I can't get user info; I am getting this message:
The remote server returned an error: (417) Expectation failed.
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
开发者_StackOverflow FBUser = Nothing
'' other work
End Try
End If
This is really confusing, because it was just working fine for 2 weeks now !!
Thanks
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>
Or it equivalent by code.
精彩评论