Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/F4pl0/FARLA
Browse files Browse the repository at this point in the history
  • Loading branch information
F4pl0 committed Sep 7, 2019
2 parents 9803221 + c8a06e2 commit 03a32dc
Showing 1 changed file with 105 additions and 2 deletions.
107 changes: 105 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,105 @@
# FARLA
F4pl0's Awesome Request Library for Android
[![](https://jitpack.io/v/F4pl0/FARLA.svg)](https://jitpack.io/#F4pl0/FARLA)
# FARLA - F4pl0's Awesome Request Library for Android

## Features
* Lightweight
> *So it can fit in every project you want*
* Native
> *Supports Java and Kotlin*
* Performance
> *Only bottleneck is your connection and server location*
* Simple
> *Implements in seconds, period*
## Installation

Add Jitpack.io repository to your build.gradle file:
```javascript
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

Add FARLA to your dependencies

```javascript
dependencies {
implementation 'com.github.F4pl0:FARLA:0.4.0'
}
```

## Usage

### GET Request
```java
new FarlaGetRequest(this)
.setURL("https://example.com/get")
.setListener(new FarlaGetRequest.onGetRequestListener() {
@Override
public void onSuccess(String response) {
//Handle the response
}

@Override
public void onFailure(int error) {
//Handle the failure
}
}).execute();
```

### POST Request
```java
new FarlaPostRequest(this)
.setURL("https://example.com/post")
.setListener(new FarlaPostRequest.onPostRequestListener() {
@Override
public void onSuccess(String response) {
//Handle the response
}

@Override
public void onFailure(int error) {
//Handle the failure
}
})
.addParam("key", "value")
.execute();
```

### PUT Request
```java
new FarlaPutRequest(this)
.setURL("https://example.com/put")
.setListener(new FarlaPutRequest.onPutRequestListener() {
@Override
public void onSuccess(String response) {
//Handle the response
}

@Override
public void onFailure(int error) {
//Handle the failure
}
})
.addParam("key", "value")
.execute();
```

### DELETE Request
```java
new FarlaDeleteRequest(this)
.setURL("https://example.com/delete")
.setListener(new FarlaDeleteRequest.onDeleteRequestListener() {
@Override
public void onSuccess(String response) {
//Handle the response
}

@Override
public void onFailure(int error) {
//Handle the failure
}
}).execute();
```

0 comments on commit 03a32dc

Please sign in to comment.