Avnish1985 / bitly-api

Automatically exported from code.google.com/p/bitly-api
0 stars 0 forks source link

Extra \n's in API responses #55

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to expand the URL http://bit.ly/hrwmv4 using bit.ly /expand API call.

$ curl 
'http://api.bitly.com/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2Fhrwmv4&login=…&
apiKey=…&format=json'
{ "status_code": 200, "status_txt": "OK", "data": { "expand": [ { "short_url": 
"http:\/\/bit.ly\/hrwmv4", "long_url": 
"http:\/\/www.zazzle.com\/pink_cream_background_wedding_invites_invitation-16113
3128304562735?gl=AllyJCat&rf=238833329128463296&t_text1=We,+Along+with+our+paren
ts,+\nWould+like+to+invite+you+to&t_text2=Our+Wedding+Day&t_text3=Saturday,+Sept
ember+First+\nTwo+Thousand+And+Twelve\nAt+Ten+In+The+Morning&t_text4=Life+church
+Jackson\n780+Highway+18\nJackson,+TN+38301&t_text5=Ashley+%26+Josh&t_text6=You'
re+also+invited+to+join+us+at+our+Reception&t_text7=Life+church+Jackson+-+780+Hi
ghway+18+-+Jackson,+TN+38301&t_text8=immediately+Following+the+Ceremony&t_text9=
RSVP+to+email@email.com+By+January+1st.&style=5x7&media=felt&color=cream&context
=default_invitation&view=front", "user_hash": "hrwmv4", "global_hash": "fjWePI" 
} ] } }

Note the '\n' characters at random positions in the "long_url" field. However, 
when I expand this url via HTTP, the "Location:" header is a single contiguous 
string without any newline characters:
$ curl -I http://bit.ly/hrwmv4
…
Location: 
http://www.zazzle.com/pink_cream_background_wedding_invites_invitation-161133128
304562735?gl=AllyJCat&rf=238833329128463296&t_text1=We,+Along+with+our+parents,+
Would+like+to+invite+you+to&t_text2=Our+Wedding+Day&t_text3=Saturday,+September+
First+Two+Thousand+And+TwelveAt+Ten+In+The+Morning&t_text4=Life+church+Jackson78
0+Highway+18Jackson,+TN+38301&t_text5=Ashley+%26+Josh&t_text6=You're+also+invite
d+to+join+us+at+our+Reception&t_text7=Life+church+Jackson+-+780+Highway+18+-+Jac
kson,+TN+38301&t_text8=immediately+Following+the+Ceremony&t_text9=RSVP+to+email@
email.com+By+January+1st.&style=5x7&media=felt&color=cream&context=default_invit
ation&view=front

Original issue reported on code.google.com by ivan.s.k...@gmail.com on 2 Dec 2011 at 1:14