Response from OAuth is "?"


#1

The past few days my twitter application has stopped working on both of my websites. I’m using classic asp as the language and this function from Scott DeSapio’s OAuth library no longer works. The responseText I receive is just “?”, no json or xml response. Everything was working fine a few days ago but now it’s completely useless. Any help?

Public Sub Send()
	Dim strRequestURL : strRequestURL = Get_RequestURL()
	On Error Resume Next
	Dim objXMLHTTP : Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0")
	objXMLHTTP.setTimeouts OAUTH_TIMEOUT_RESOLVE, OAUTH_TIMEOUT_CONNECT, OAUTH_TIMEOUT_SEND, OAUTH_TIMEOUT_RECEIVE
	objXMLHTTP.Open m_strRequestMethod, strRequestURL, False
	objXMLHTTP.SetRequestHeader "Content-Type","application/x-www-form-urlencoded"
	objXMLHTTP.Send()
	If Err.Number <> 0 Then
		Select Case CStr(Err.Number)
			Case CStr(OAUTH_ERROR_TIMEOUT)
				Response.Redirect m_strTimeoutURL
				Response.End
			Case Else
				m_strErrorCode = Err.Number
		End Select
	Else
		m_strResponseText = objXMLHTTP.ResponseText
	End If
	Set objXMLHTTP = Nothing
	On Error Goto 0
End Sub

The objXMLHTTP.ResponseText just contains “?” and not a error or anything else. I’ve been fiddling with this and I can’t see where the issue is. I know that you guys have made HTTP standards more strict but it looks like I’m sending all the correct/valid HTTP headers. Content-Length is generated correctly, the server time is correct, I’ve checked the hostname in the headers as well and that’s fine.


#2

We’re looking into this issue. Our current theory is that this is related to a bug where gzip’d responses are being served due to a specific User agent or perhaps some other criteria. The first character of our gzip responses tend to be “?” which kind of matches up with this scenario. Are you setting an explicit User-Agent HTTP header? If so, do you know what it is?


#3

Thanks for the fast response, I’m not specifically setting an User-Agent header, if there is one specified, it was sent automatically with the other default http headers.


#4

Hey have you guys been able to find the source of this bug yet?


#5

Still under investigation.


#6

Alright thanks. Is there anything else I could provide to help fix this?


#7

Hi Brian,

Feel free to use my ASPTwitter class as a starting point. The code already does OAuth authentication and gets tweets, and works with Twitter API 1.1. Just copy the token method and change the API URL and post data:

http://www.timacheson.com/Blog/2013/jun/asptwitter


#8

Hi – see my reply below. :slight_smile: