Đây là cách tôi gọi một dịch vụ với NET:Tại sao tôi nhận được lỗi 411 Độ dài bắt buộc?
var requestedURL = "https://accounts.google.com/o/oauth2/token?code=" + code + "&client_id=" + client_id + "&client_secret=" + client_secret + "&redirect_uri=" + redirect_uri + "&grant_type=authorization_code";
HttpWebRequest authRequest = (HttpWebRequest)WebRequest.Create(requestedURL);
authRequest.ContentType = "application/x-www-form-urlencoded";
authRequest.Method = "POST";
WebResponse authResponseTwitter = authRequest.GetResponse();
nhưng khi phương pháp này được gọi, tôi nhận được:
Exception Details: System.Net.WebException: The remote server returned an error: (411) Length Required.
những gì tôi nên làm gì?
Bạn có thể tham khảo câu hỏi của tôi "http://stackoverflow.com/questions/35308945/accessing-sftp-url-from-console-application-using-c-sharp" không? Tôi đang gặp vấn đề tương tự. Tôi đang cố gắng truy cập URL SFTP –