The remote server returned an error: (404) Not Found.

kuznetsov_mi
@kuznetsov_mi Кузнецов Максим

I have an error The remote server returned an error: (404) Not Found since 15 oct. Hope, please...

My code:
///
/// Send message to Twitter
///
private bool PostTweet(string tweet, string consumerKey, string consumerSecret, string token, string tokenSecret,
string pin, string url)
{
bool isSend = false;
try
{
if (url != String.Empty)
{
if ((url.Length > URLMaxLength) || (IS_USE_TINYURL_SERVICE))
url = MakeTinyUrl(url);
}
else
{
}

if ((String.Format("{0}{2}{1}", tweet, url, (url == String.Empty) ? ("") : (" "))).Length > 140)
tweet = String.Format("{0}...{2}{1}", tweet.Substring(0, ((url == String.Empty) ? (137) : (136)) - url.Length), url, (url == String.Empty) ? ("") : (" "));
else
tweet = String.Format("{0}{2}{1}", tweet, url, (url == String.Empty) ? ("") : (" "));

oAuthTwitter _oAuth = new oAuthTwitter();

_oAuth.ConsumerKey = consumerKey;
_oAuth.ConsumerSecret = consumerSecret;

_oAuth.Token = token;
_oAuth.TokenSecret = tokenSecret;
_oAuth.Verifier = pin;

string xml = _oAuth.oAuthWebRequest(oAuthTwitter.Method.POST, "http://twitter.com/statuses/update.xml", "status=" + tweet); // return an error
isSend = true;

}
catch (Exception ex)
{
LoggerFactory.Logger.WriteMessage(LogMessage.FromException(new Exception(String.Format("Error: {0}", ex.Message))));
}

return isSend;

}

1 year 26 weeks ago

Replies

episod
@episod Taylor Singletary

You're using outdated and retired URLs to access the API. You'll need to upgrade your code.

Look at:

Why am I getting a HTTP 404 for my timeline feed?

If you're requesting a timeline URL that used to work but now does not, you are likely using an outdated URL that has been retired. In March of 2012 we announced that "unversioned endpoints," GET statuses/public_timeline, and the v1 REST ATOM response format were deprecated and would eventually cease functioning. In early October 2012, we turned off these endpoints.

You can identify unversioned endpoints by examining their URL: http://twitter.com/statuses/user_timeline/twitterapi.rss is missing both the API version and the "api" subdomain. The correct URL for the same request would be https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=twitterapi

Please note that there is no support for the RSS response format in API v1.1. Properly versioned API v1 URLs will cease functioning in March 2013.

For help dealing with the Spring 2012 deprecations, see Following up on API housekeeping.

1 year 26 weeks ago
kuznetsov_mi
@kuznetsov_mi Кузнецов Максим

Thank you!

1 year 26 weeks ago
twahodvoice
@twahodvoice صوت مرضى التوحد

i all ready created application , i still have the error, pls. tell me how to use application. to do tweet.

1 year 26 weeks ago
ManishSingh_vns
@ManishSingh_vns Manish Singh

hey guyes whats up?

1 year 8 weeks ago
ManishSingh_vns
@ManishSingh_vns Manish Singh

fhgdfhdhdffhgdgf

1 year 8 weeks ago