java.io.IOException: Server returns HTTP response code 505

前端 未结 5 930
北海茫月
北海茫月 2020-12-15 20:11

I have HTML based queries in my code and one specific kind seems to give rise to IOExceptions upon receiving 505 response from the server. I have looked up the

5条回答
  •  失恋的感觉
    2020-12-15 20:27

    from the API documentation for the URL class:

    The URL class does not itself encode or decode any URL components [...]. It is the responsibility of the caller to encode any fields, which need to be escaped prior to calling URL, and also to decode any escaped fields, that are returned from URL.

    so if you have any spaces in your url-str encode it before calling new URL(url-str)

提交回复
热议问题