Code Monkey home page Code Monkey logo

nettop's Introduction

NetTop

使用HttpUrlConnection进行封装的请求,支持多文件上传,图片下载 使用demo final TextView textView=(TextView)this.findViewById(R.id.text); firstRequest arequest=new firstRequest(); BaseNetTopBusiness baseNetTopBusiness=new BaseNetTopBusiness(new NetTopListener() { @Override public void onSuccess(HttpResponse response) { System.out.println("成功"); byte[] bytes=response.bytes; System.out.println(new String(bytes)); textView.setText(new String(bytes)); }

        @Override
        public void onFail() {
            System.out.println("on fail");
            textView.setText("fail");
        }

        @Override
        public void onError() {
            System.out.println("on error");
            textView.setText("error");
        }
    });
    baseNetTopBusiness.startRequest(arequest);
    
    首先新建请求对象类
    public class firstRequest implements Request

{ public String requestUrl="http://192.168.56.1:18080/login-mobile"; public String user="novsssse3333as"; public String password="mengfanshan"; } 必须实现Request接口,其中user,password为上传参数key,requestUrl变量名不可以改变,表示请求网址,修饰符类型可以为public,private均可

nettop's People

Contributors

novas-meng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.