Expectation Failed when trying to update twitter status

前端 未结 3 1016
清歌不尽
清歌不尽 2021-01-26 04:46

I can\'t seem to figure this one out. No matter what I do, I keep getting a \"417 Expectation failed\" error. Everywhere I\'ve looked says that I need to get rid of the Expect h

3条回答
  •  情话喂你
    2021-01-26 05:30

    Set the Expectation to "expect:nothing" ..this is my code:

    var data = new Dictionary();

    data.Add("status", status);

    HttpWebRequest request = twitter.PrepareAuthorizedRequest(UpdateStatusEndpoint, accessToken, data);

    request.Expect = "expect:nothing";

    var response = twitter.Channel.WebRequestHandler.GetResponse(request); exception return XDocument.Load(XmlReader.Create(response.GetResponseReader()));

    it worked for me...

提交回复
热议问题