bit.ly fails to encode localhost

1,129 views
Skip to first unread message

Dano!

unread,
Jan 2, 2014, 12:57:36 PM1/2/14
to bitl...@googlegroups.com

Does bit.ly not encode any URL with 'localhost' as the domain?

AFAICT it does not, but I haven't been able to find anything specifically talking about this in either the API docs or on the internets.

Fail example (formatted and URL simplified to make it easier to read):
login=MY_LOGIN&apiKey=MY_API_KEY& 
longUrl=http%3A%2F%2Flocalhost%2F 
&version=3&history=1

It works properly if the 'localhost' above is changed to 'localhost.com' or 'localhost.toast'.

Thanks,
Dano!

James Socol

unread,
Jan 2, 2014, 2:21:01 PM1/2/14
to bitl...@googlegroups.com
Hi Dano,

That's correct, encoding links to localhost does not work.

You're also using a deprecated API endpoint and authentication method. If possible you should switch to using OAuth authentication and the v3/shorten endpoint.

Hope that clears things up,

James

Dano!

unread,
Jan 2, 2014, 4:53:17 PM1/2/14
to bitl...@googlegroups.com

Thanks for the clarification!

Re: old version.... Yea, I'm using a legacy library.  Will put updating it on the Someday TODO and hope the legacy sticks around for a while.  Hope... a great way to manage projects.  :)

Dano!
Reply all
Reply to author
Forward
0 new messages