Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 1.19 KB

README.md

File metadata and controls

42 lines (22 loc) · 1.19 KB

FoolHttp

Note:

This is a simple kotlin demo of http, and it's modefied by Fuel

Demo of using:

method: fun get(path: String, parameters: List<Pair<String, Any?>>? = null, successCallBack: (response: Response) -> Unit = null!!, failCallBack: (response: Response, request: Request) ->Unit = null!!) ,you can find get demo from Manager.

Simple demo:

 test1.setOnClickListener { view ->

        FoolHttp.get("https://www.baidu.com", null, { response ->
            runOnUiThread {
                codeText.text = "status:" + response.httpStateCode.toString();
                webview.loadData(response.toString(), "text/html", response.httpEncode);

            }

        }, { response, request ->
            runOnUiThread {
                codeText.text = "failed:" + response.httpStateCode.toString();

            }

        });

    }

Others

If you are interesting in it.I draw this uml diagram in order to help understand it's structure.