android java.net.ProtocolException: Connection already established

后端 未结 5 2039
南笙
南笙 2020-12-20 06:27
public static Bitmap getImage(String address) throws Exception {

    Bitmap imgmap = null;
    InputStream is = null;

    URL url = new URL(address);

    HttpURLC         


        
5条回答
  •  甜味超标
    2020-12-20 06:49

    When you create an instance of HttpURLConnection it defaults to the request method GET so there is no need to call setRequestMethod in this instance.

    This link contains some fantastic detail about HTTP connections and how to use them.

提交回复
热议问题