This is the second part of my HTTP Twitter posting series. Within this post I start to build upon the ExecuteString method that encapsulates the HttpWebRequest object and process.If you want to read related articles they can be found here:
The code example below overrides the virtual method ExecuteString within its own class. This means the HttpWebRequest class can be used to post to other APIs that use HTTP as its transportation method.
The ExecuteString method below is used to piece all of the communication parts that are needed for a successful Twitter post. This includes the Twitter URL and PostingParameters, whether a user account login is required for the API call, and the method of the call (Post, Get, or Delete).
protected override string ExecuteString(PostingParameters PostingParameters, bool LoginRequired, Method Method)
{
PostingParameters.URL =
String.Format(“{0}{1}”, Config.TwitterURL, PostingParameters.URL);
return base.ExecuteString(PostingParameters, LoginRequired, Method);
}
In my next post I’ll implement a method call that posts a status change to show the total lifecycle of a Twitter call.
In the meantime it’ll be good to hear from you. Feel free to post comments and ask questions.
About James McLeod, Managing Director at Narvi Digital Media, Brighton
Advertisement



[...] of the fundamental communications hub of the Twitter API. The second article can be found here: HTTP Posting to Twitter Part 2 By using the HttpWebRequest class I have created a number of methods that manage http posts and [...]
By: HTTP Posting to Twitter Part 1 « James McLeod on October 26, 2009
at 10:15 pm
[...] seen my previous posts please feel free to read them here: HTTP Posting to Twitter Part 1 and HTTP Posting to Twitter Part 2. I’m also more than happy to accept comments on all my [...]
By: HTTP Posting to Twitter Part 3 « James McLeod on November 4, 2009
at 10:01 pm