I have a draft written, I'm going to compile and debug tonight. I'll post my code and/or dll when I'm finished.
On Apr 8, 7:09 am, Dimebrain <[email protected]> wrote: > I confirmed this is still happening by tracing with wireshark last > night; so my expectation for preauthenticate was wrong as it doesn't > stop the initial grab for authentication flavor; setting the header > yourself does the trick for that first call. > > On Apr 8, 2:21 am, James Deville <[email protected]> wrote: > > > > > Almost. request.PreAuthenticate still sends a double request the first time. > > Behind corporate firewalls (where multiple clients may be getting aggregated > > to one IP address), you can still hit the unauth'ed rate limit. > > > I'll try tomorrow at work (where I can usually repro the above situation) > > and report back. > > > JD > > > On Tue, Apr 7, 2009 at 11:29 AM, Dimebrain <[email protected]> wrote: > > > > Isn't request.PreAuthenticate = true functionally equivalent to adding > > > the credentials manually to avoid the double calls? > > > > On Apr 5, 1:21 am, James Deville <[email protected]> wrote: > > > > Look at what requests you are sending with Netmon or Wireshark. With > > > Witty > > > > (C# wpf app), we discovered that first an unauthenticated request is > > > > sent > > > to > > > > find out what auth the server takes, then a authenticated request after > > > > that. This doesn't work on some of the API requests. The solution is to > > > > manually attach the BasicAuth header. > > > > > JD > > > > > On Sat, Apr 4, 2009 at 11:38 AM, DIENECES <[email protected]> > > > wrote: > > > > > > Any idea why I'm forbidden? > > > > > Thanks in advance! > > > > > Function writeMessage(ByVal StrPass, ByVal StrUser, ByVal StrMessage, > > > > > ByVal StrTo) As String > > > > > Dim req As System.Net.HttpWebRequest = > > > > > System.Net.HttpWebRequest.Create("http://twitter.com/direct_messages/ > > > > > new.xml?user= <http://twitter.com/direct_messages/%0Anew.xml?user=>" + > > > > > StrTo + "&text=" + StrMessage) > > > > > If Not StrUser = "" Or StrPass = "" Then > > > > > req.Credentials = New System.Net.NetworkCredential > > > > > (StrUser, StrPass) > > > > > req.Method = "POST" > > > > > 'req.ContentLength = 0 > > > > > 'req.ServicePoint.Expect100Continue = False > > > > > req.ContentType = "application/x-www-form-urlencoded" > > > > > 'req.PreAuthenticate = True > > > > > Dim resp As HttpWebResponse = req.GetResponse() > > > > > Dim sr As New System.IO.StreamReader(resp.GetResponseStream > > > > > ()) > > > > > 'sr.Read(req.GetResponse(), ) > > > > > Return sr.ReadToEnd() > > > > > End If > > > > > > End Function- Hide quoted text - > > - Show quoted text -
