setRequestProperty method giving java.lang.IllegalStateException: Cannot set method after connection is made

后端 未结 3 1264
忘掉有多难
忘掉有多难 2020-12-11 19:14
HttpURLConnection con = null;
        Response response = new Response();
        String TAG = \"HttpConHandler\";

        try{
            /*
             * IMPORT         


        
3条回答
  •  情话喂你
    2020-12-11 19:42

    This may work:

    URL url = new URL(urlStr);
    con = (HttpURLConnection) url.openConnection(); 
    con.setDoOutput(true);
    con.setRequestProperty("Authorization", q);
    con.setRequestProperty("GData-Version", "3.0");
    

提交回复
热议问题