Skip to content

bhavin250495/Cazzy-Simple-Networking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cazzy-Simple-Networking

Add repositories in build.gradle (Project:YOUR_APP_NAME)

repositories {
      jcenter()
      maven { url 'https://jitpack.io' }
  }

Add dependencies in build.gradle (Module:app)

dependencies {

//... other dependencies

compile 'com.github.bhavin250495:Cazzy-Simple-Networking:1.0'

}

Usage

HTTP GET REQUEST

   Http_request.sendGetRequest("url", new ResponseHandler() {
                              @Override
                              public void getResponse(ServerResponseWrapper serverResponseWrapper) {
                                  if (serverResponseWrapper.isSuccess){
                                      Log.d("TAG",serverResponseWrapper.response);
                                  }else{
                                      Log.d("TAG",serverResponseWrapper.response);
                                  }
                              }
                          });

HTTP POST REQUEST

   Http_request.sendPostRequest("url", JsonParam.toString(), new ResponseHandler() {
                              @Override
                              public void getResponse(ServerResponseWrapper serverResponseWrapper) {
                                  if (serverResponseWrapper.isSuccess){
                                      Log.d("TAG",serverResponseWrapper.response);
                                  }else{
                                      Log.d("TAG",serverResponseWrapper.response);
                                  }
                              }
                          });