Bit INVALID_URI - '500'

I am using Bitly gem (https://github.com/philnash/bitly) for Bitly API Version 3

I get an error while shortening the url when deploying the application to Heroku. Locally contraction is declining.

def get_short_url(url) Bitly.use_api_version_3 bitly = Bitly.new(Settings.bitly.login, Settings.bitly.api_key) result = bitly.shorten(url) ----------------- Line 3 result.short_url end 

Line 3 in the code above gives the error INVALID_URI - '500'.

The URL I'm trying to shorten is

 "https://rs-4615.xyz.com/users/profile_view/20492083" 

This reduces the penalty when I use bitly.com.

I can not understand this problem. Can anyone help?

Shardul.

+7
source share
1 answer

Answer and acceptance in case someone else is facing the same problem.

The problem was that the URL generated in my code did not prepare the https protocol for the URL, and therefore failed.

So what was created was

 rs-4615.xyz.com/users/profile_view/20492083 

INSTEAD

https://rs-4615.xyz.com/users/profile_view/20492083 - This is the right option.

@jstim, thanks for your help.

+11
source

All Articles