0
내 응용 프로그램에서 트윗을 업로드하려고 할 때 안녕하십니까, 웹 클라이언트를 업로드 할 때 데이터를 업로드하면 WebExecption을 반환합니다. "원격 서버에서 오류를 반환했습니다 : (417) Expectation Failed. "인터넷을 살펴본 후에 사람들은 기대에 부합하기 위해 expect100을 계속 제출해야한다는 것을 알았습니다. 내 코드를 다시 살펴본 후 이미 코드에 snippiet가 있습니다. 다른 사람들이 왜 작동하지 않는지 알고 있습니까?WebClient UploadData는 expect100Continue를 false로 설정 한 후에도 417 오류를 반환합니다.
여기 내 코드가 있습니다.
public bool PostTweet(string tweet)
{
string aUrl = "http://twitter.com/statuses/update.xml";
client.Credentials = new NetworkCredential(_username, _password);
System.Net.ServicePointManager.Expect100Continue = false;
byte[] tweetBytes = System.Text.Encoding.UTF8.GetBytes("status=" + tweet);
client.UploadData(aUrl,tweetBytes);
return true;
}
희망이 사전에 후 false로 Expect100Continue을 변경 instanse 웹 클라이언트를 만들 수