HttpClient已弃用,URIBuilder不会出现?

时间:2016-02-16 03:36:03

标签: java android deprecated uribuilder

@Override
        protected Void doInBackground(Void... params) {
        ArrayList<Pair> dataToSend = new ArrayList<>();
        dataToSend.add(new Pair("name", user.name));
        dataToSend.add(new Pair("username", user.username));
        dataToSend.add(new Pair("age", user.age));
        dataToSend.add(new Pair("password", user.password));

        URIBuilder builder = //
        HttpParams httpRequestParams = new BasicHttpParams();
        return null;
    }

1 个答案:

答案 0 :(得分:0)

在您的项目中src/build.gradle

添加此行

 dependencies {
     compile 'org.apache.httpcomponents:httpclient:4.0-alpha4'
  }

现在同步您的项目并构建您的项目。