Make an HTTP request with android

后端 未结 12 1116
时光取名叫无心
时光取名叫无心 2020-11-21 06:38

I have searched everywhere but I couldn\'t find my answer, is there a way to make a simple HTTP request? I want to request a PHP page / script on one of my websites but I do

12条回答
  •  情深已故
    2020-11-21 07:16

    private String getToServer(String service) throws IOException {
        HttpGet httpget = new HttpGet(service);
        ResponseHandler responseHandler = new BasicResponseHandler();
        return new DefaultHttpClient().execute(httpget, responseHandler);
    
    }
    

    Regards

提交回复
热议问题