I have been trying to shorten URL contains % symbol to bitly shorten API:
Examples
My Original URL:
Doesn't work
When I try to eliminate the percent from URL, then encoded it again, it works:
I am not able to find Bitly doc states it does not able to shorten percent contained URL
Anyone has advise?
The URL you're passing to shorten isn't a syntactically valid URL. Perhaps you meant ...&longUrl=https%3A%2F%2Fwww.google.com%3Fparam%3D40%2525OFF
, which when decoded gives longUrl
the value https://www.google.com?param=40%25OFF
, which when decoded gives param
the value 40%OFF
. Without the "extra" 25
, decoding fails at the second step since O
isn't a hexadecimal digit.