Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

malformed url exception

Tags:

java

url

https://twitter.com/sessions?authenticity_token=b1b43178e09c1e6ccec1b3183f1f139f39643aaf&session%5Busername_or_email%5D=ddddd&session%5Bpassword%5D=rrrrr&q=&site_action=https%3A%2F%2Ftwitter.com%2Fsessions&serialized_string=Hello

why is this url throwing a java.net.MalformedURLException??

like image 886
Bunny Rabbit Avatar asked Dec 06 '25 04:12

Bunny Rabbit


1 Answers

The only reason I can think of is if your code is mistakenly applying the URL decoder to the URL string before trying to parse the URL. That would replace the %xx escapes with the characters they stand for, and you'd end up with illegal characters in the "query" part of the URL.

Please post the code that throws the exception.

like image 190
Stephen C Avatar answered Dec 09 '25 18:12

Stephen C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!