Tutorial :malformed url exception



Question:

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??


Solution:1

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »