Skip to content

androdocs/Simple-HTTP-Request

Repository files navigation

Simple-HTTP-Request

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

 

Step 2. Add the dependency

dependencies {
        implementation 'com.github.androdocs:Simple-HTTP-Request:v1.0'
}

 

Step 3. Get return result from URL in your AsyncTask doInBackground()

class webTask extends AsyncTask<String, Void, String> {
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
		....
    }
protected String doInBackground(String... args) {
    String response = HttpRequest.excuteGet("https://www.androdocs.com/files/uploads/original/sample-json-data-1567767983.txt");
    return response;
}

@Override
protected void onPostExecute(String result) {
	....
}

}

 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages