HttpUtils 的post请求

//HttpUtils 的post请求
public void httpuplode(String fileData){
String url=”http://app.chunchennet.cn/index/UpPhonePic.html”;
HttpUtils httpUtils=new com.lidroid.xutils.HttpUtils();
String ticket=PreferencesUtil.getPreferences(MakeFriend.TICKET_TOKEN,”“,getActivity());
RequestParams params=new RequestParams();
params.addBodyParameter(“ticket”,ticket);
params.addBodyParameter(“fileData”,fileData);
httpUtils.send(HttpRequest.HttpMethod.POST, url, params, new RequestCallBack() {

            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {
                Log.i("aaa",responseInfo.result);
              Gson gson=new Gson();
                MyUp frinendUser = gson.fromJson(responseInfo.result, MyUp.class);
                BitmapUtils bitmapUtil=new BitmapUtils(getActivity());

// bitmapUtil.display(my_uploding,frinendUser.getUrl());

            }

            @Override
            public void onFailure(HttpException e, String s) {
                Toast.makeText(getActivity(),"失败",Toast.LENGTH_SHORT).show();
            }
        });
    }

你可能感兴趣的:(HttpUtils 的post请求)