问题
I'm working on a project involving grabbing twitter data info, parsing it, and displaying it on our website for administration purposes. We're also looking into posting tweets or updates via a web interface interlocked with the Twitter REST API, but to start off, I wanted to do simple GETs. I'm trying to do one of my home_timeline via the API documentation on dev.twitter.com, and I'm getting a 400 Bad Request error in my data response. This is the ColdFusion code I'm using to execute that GET (actual codes removed for security):
<cfhttp url="https://api.twitter.com/1.1/statuses/home_timeline.json" method="get" result="thisGet">
<cfheader name="oauth_consumer_key" value="*ConsumerKeyCode*">
<cfheader name="oauth_nonce" value="*NonceCode*">
<cfheader name="oauth_signature" value="*SignatureCode*">
<cfheader name="oauth_signature_method" value="HMAC-SHA1">
<cfheader name="oauth_timestamp" value="1349816229">
<cfheader name="oauth_token" value="*TokenCode*">
<cfheader name="oauth_version" value="1.0">
<cfhttpparam name="username" value="*TwitterUserName*" type="formfield">
<cfhttpparam name="password" value="*TwitterPassword*" type="formfield">
</cfhttp>
Can anyone tell me what I'm doing wrong here? Thanks!
UPDATED: Changed home.timeline to home_timeline.
回答1:
I know nothing about the Twitter API, but from 2min of googling, I'm seeing a lot of references to home_timeline
, and none for home.timeline
. Are you sure you've got that right?
来源:https://stackoverflow.com/questions/12809057/coldfusion-twitter-api-bad-request