Since 1 December responses from statuses/update are garbage


#1

We are still using API v1.

It seems that since around 1 December, we can no longer interpret the responses we receive when posting to:

https://api.twitter.com/1/statuses/update.json

Has been working for months, but instead of getting a readable JSON response, we now get a load of garbage characters, such as:

¬? ?U?? ??-?? ?h? iS
/ Z ?)??v.?wd],? M¬? I3???ï\ ??
?"xpB?£?Z???<[-??Ew??J?’‘6???4???k~?S?? N?s?x?i>??O??[?P?Og??8?? V???e?K??? c]-??T?
?#k? O ??? J!?<?5 ,???b?G??(??Z?2[?UR{??t?-??j???ud. ?%M?+??8? P\ ?O
?
X [U p8?k$ T? O?[@??? J???-?i wL? ?{ ?94a,?J ?5~?z?HD ?q?| ? ? ?S?@? Fn? ?k?o??P???*???J3l? ???vr0[???w??@?m{?=?<? ?d¬??? < ??K???D+?¬???f??Q???y?.???QK??? I?:???ICp???u? ? ???K?1U{???t9??jq&7?2TaX@??W??,E))S?_?r9? ???S? A???=? ?? 8?? ?B? ?G???e??n?’’??? ???^??N?g? M!z???W5?4>??*?/?Vt?]W -?A.???í??? :??j[? ?x??y ?O If

Not sure what changed.

Can anyone help?

Thanks


#2

I’m looking into reports like this – do you know what HTTP headers you’re sending in the request? That appears to be a gzipped response. Are you indicating that you’re client is capable of receiving gzipped responses?


#3

It looks like some user-agent values are triggering this. I was able to reproduce by sending “Mozilla/4.0”. Does changing/removing the user agent help?


#4

Hello - sorry for the delay in replying, I couldn’t find this thread to check for replies.

We are using MSXML 4.0 that comes with Windows. Specifically, the ServerXMLHTTP Request.

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()
		' check for errors
		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
        Response.write m_strResponseText 
        Response.end 

m_strResponseText contains garbage.


#5

It seems like an encoding issue of some sort. Changed it to try and handle UTF-8 but still no joy.

            objXMLHTTP.SetRequestHeader "Content-Type","application/x-www-form-urlencoded;charset=UTF-8"
            Response.CodePage = 65001
            Response.Charset = "UTF-8"

The OAUTH stuff is also returning garbage when trying to login.

Would expect responses not to contain any non-ASCII characters unless some had been supplied in the original post.

Real head scratcher.


#6

Yes, perhaps it is the User Agent, when I set it to something else, it works.

objXMLHTTP.SetRequestHeader “User-Agent”, “OAuth gem v0.4.4”

Found that advice in this post: https://dev.twitter.com/discussions/12815