Giter Site home page Giter Site logo

kittinunf / fuel Goto Github PK

View Code? Open in Web Editor NEW
4.5K 75.0 425.0 2.41 MB

The easiest HTTP networking library for Kotlin/Android

Home Page: https://fuel.gitbook.io/documentation/

License: MIT License

Kotlin 99.73% HTML 0.27%
kotlin rxjava networking android http-client rest

fuel's Introduction

Hello everyone, I'm Kittinun :)

I love Open source and Github is my second home 🏠

  • I'm from Bangkok, Thailand but currently based in Tokyo, Japan 🗼
  • 👨‍💻 Long time Android/iOS Engineer with some ❤️ for Kotlin & Swift
  • Passionate about building great mobile apps 🍎 🤖
  • Occassionally, play around with C++, ❤️ functional programming and try to be good at it
  • You can find me here 🐦 @kittinunf

I am currently looking for Github Sponsor so I can do this more on my free time.

fuel's People

Contributors

inoles avatar kittinunf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuel's Issues

request JSON encode

So Fuel can parse a JSON response... but can it encode an object to JSON for a request?

Specify Cookies through Fuel instead of using java.net.CookieManager

Android uses a separate cookie manager for WebViews, android.webview.CookieManager, which requires type coercion to properly load into the standard java.net.CookieManager, which is used by Fuel via HttpURLConnection.

Would it be possible to have a Fuel standard interface for loading/retrieving/managing Cookies?

? is added to the url

Dark magic has happened to me during development:

Log.e("tag", url)
val request = url.httpGet()
Log.e("tag", request.url.toString())
E/tag: http://ohel-shem.com/php/changes/changes_sys/index.php?layer=11
 E/tag: http://ohel-shem.com/php/changes/changes_sys/index.php?layer=11?

This ? is breaking the url for this site.
Even adding / a the end of the url seem to doesn't work.

Edit: Encoding.kt

 if (encodeParameterInUrl(method)) {
            val query = if (path.last().equals("?")) "" else "?"
            modifiedPath += query + queryFromParameters(parameters)

Change Request Timeout

Hi,

Just wondering, how would you change the default request timeout on a per invocation basis?

Thanks

Can't post parameters correctly

When using the following java implementation

    String body = "\"email\": \"[email protected]\", \"password\": \"somepass\"";

    Fuel.post(login_url).body(body, Charset.forName("UTF-8")).responseString(new Handler<String>() {
        @Override
        public void failure(Request request, Response response, FuelError error) {
            //do something when it is failure
        }

        @Override
        public void success(Request request, Response response, String data) {
            //do something when it is successful
        }
    });

the params get posted as one whole string, as registered on my rails server

    {"\"email\": \"[email protected]\", \"password\": \"somepass\"" => nil }

What is the correct way to post them?

Use proper package name

Hi, your project seems cool!

But it doesn't follow package naming standards, so if you don't have any other website, Fuel's package name should be com.github.kittinunf.fuel :)

Thanks

Headers are empty on simple GET request

Hi there

I just tried "http://httpbin.org/get".httpGet() which is the blocking version and I found the headers to be empty. What's going on there?

Thanks

S3 Download URL Encoding Fails

`cancel()` doesn't cancel the underlying HTTP request.

the HttpUrlConnection or HttpClient should be closed also.

My request is a Comet – after request is sent the server keeps it for 30 seconds and either respond with array of events if these events has occured, or respond with empty array if there was no events.
So my case is this:

  1. request sent
  2. in 2-5 seconds I perform a cancellation
  3. nothing is cancelling (according to the mitmproxy) and after the timeout the success handler is calling

Malformed header cause failure

HTTP normal headers:

header1: value1 \r\n
header2: value2 \r\n

So, if we set a malformed value, for example a\nb\nc:

Fuel.get("https://www.google.com/").header("sample" to "a\nb\nc").responseString { request, response, result -> 
 result.failure {
   it.printStackTrace()
}
}

we get:

Exception : Illegal character(s) in message header value: a
b
c
    at com.github.kittinunf.fuel.toolbox.HttpClient.executeRequest(HttpClient.kt:69)
    at com.github.kittinunf.fuel.core.requests.TaskRequest.call(TaskRequest.kt:17)
    at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:13)
    at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:6)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.github.kittinunf.fuel.core.FuelManager$executor$2$1$1.run(FuelManager.kt:43)
    at java.lang.Thread.run(Thread.java:745)

HTTPS certificate not validated by default

By default socketFactory and hostnameVerifier are null, which makes HTTPS connections pointless and is a huge security risk. This should be the default:

Manager.instance.socketFactory = javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory()
Manager.instance.hostnameVerifier = javax.net.ssl.HttpsURLConnection.getDefaultHostnameVerifier()

Proguard rules required

background: my app was running fine in debug mode, but in release mode it wasn't working fine. Some ui things weren't working, unless I rotated the screen. 1 day later, I decided to take a look at the classes proguard was removing, and noticed that various classes for Fuel were being removed. After adding some catch-all keep statements, the app seems to be working again.

The proguard rules I am currently using are:

-keep class com.github.kittinunf.**
-keep public class com.github.kittinunf.** {
  public protected *;
}

These could just be added to the proguard-rules.pro file, but it would be better if the rules were more specific. The classes that were being removed before adding these rules were:

com.github.kittinunf.fuel.Fuel:
    8:8:public Fuel()
    8:8:public static final synthetic void access$setTestConfiguration$cp(com.github.kittinunf.fuel.util.TestConfiguration)
    public static final void testMode(kotlin.jvm.functions.Function1)
    public static void testMode()
    public static final void regularMode()
    public static final com.github.kittinunf.fuel.core.Request get(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request get(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request get(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request get(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request post(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request post(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request post(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request post(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request put(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request put(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request put(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request put(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request delete(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request delete(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request delete(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request delete(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request download(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request download(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request download(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request download(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request upload(java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List)
    public static com.github.kittinunf.fuel.core.Request upload(java.lang.String,com.github.kittinunf.fuel.core.Method)
    public static com.github.kittinunf.fuel.core.Request upload(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method,java.util.List)
    public static com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method)
    public static com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request head(java.lang.String,java.util.List)
    public static com.github.kittinunf.fuel.core.Request head(java.lang.String)
    public static final com.github.kittinunf.fuel.core.Request head(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    public static com.github.kittinunf.fuel.core.Request head(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static final com.github.kittinunf.fuel.core.Request request(com.github.kittinunf.fuel.Fuel$RequestConvertible)
com.github.kittinunf.fuel.Fuel$Companion:
    18:18:public final void setTestConfiguration$fuel_compileKotlin(com.github.kittinunf.fuel.util.TestConfiguration)
    22:23:public final void testMode(kotlin.jvm.functions.Function1)
    21:21:public static bridge synthetic void testMode$default(com.github.kittinunf.fuel.Fuel$Companion,kotlin.jvm.functions.Function1,int,java.lang.Object)
    public void testMode()
    26:26:public final void regularMode()
    31:31:public static bridge synthetic com.github.kittinunf.fuel.core.Request get$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request get(java.lang.String)
    37:37:public final com.github.kittinunf.fuel.core.Request get(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    36:36:public static bridge synthetic com.github.kittinunf.fuel.core.Request get$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request get(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    42:42:public static bridge synthetic com.github.kittinunf.fuel.core.Request post$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request post(java.lang.String)
    48:48:public final com.github.kittinunf.fuel.core.Request post(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    47:47:public static bridge synthetic com.github.kittinunf.fuel.core.Request post$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request post(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    54:54:public final com.github.kittinunf.fuel.core.Request put(java.lang.String,java.util.List)
    53:53:public static bridge synthetic com.github.kittinunf.fuel.core.Request put$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request put(java.lang.String)
    59:59:public final com.github.kittinunf.fuel.core.Request put(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    58:58:public static bridge synthetic com.github.kittinunf.fuel.core.Request put$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request put(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    65:65:public final com.github.kittinunf.fuel.core.Request delete(java.lang.String,java.util.List)
    64:64:public static bridge synthetic com.github.kittinunf.fuel.core.Request delete$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request delete(java.lang.String)
    70:70:public final com.github.kittinunf.fuel.core.Request delete(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    69:69:public static bridge synthetic com.github.kittinunf.fuel.core.Request delete$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request delete(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    76:76:public final com.github.kittinunf.fuel.core.Request download(java.lang.String,java.util.List)
    75:75:public static bridge synthetic com.github.kittinunf.fuel.core.Request download$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request download(java.lang.String)
    81:81:public final com.github.kittinunf.fuel.core.Request download(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    80:80:public static bridge synthetic com.github.kittinunf.fuel.core.Request download$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request download(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    87:87:public final com.github.kittinunf.fuel.core.Request upload(java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List)
    86:86:public static bridge synthetic com.github.kittinunf.fuel.core.Request upload$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request upload(java.lang.String,com.github.kittinunf.fuel.core.Method)
    public com.github.kittinunf.fuel.core.Request upload(java.lang.String)
    92:92:public final com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method,java.util.List)
    91:91:public static bridge synthetic com.github.kittinunf.fuel.core.Request upload$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method)
    public com.github.kittinunf.fuel.core.Request upload(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    98:98:public final com.github.kittinunf.fuel.core.Request head(java.lang.String,java.util.List)
    97:97:public static bridge synthetic com.github.kittinunf.fuel.core.Request head$default(com.github.kittinunf.fuel.Fuel$Companion,java.lang.String,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request head(java.lang.String)
    103:103:public final com.github.kittinunf.fuel.core.Request head(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    102:102:public static bridge synthetic com.github.kittinunf.fuel.core.Request head$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public com.github.kittinunf.fuel.core.Request head(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    107:107:static bridge synthetic com.github.kittinunf.fuel.core.Request request$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.core.Method,java.lang.String,java.util.List,int,java.lang.Object)
    112:112:private final com.github.kittinunf.fuel.core.Request request(com.github.kittinunf.fuel.core.Method,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    111:111:static bridge synthetic com.github.kittinunf.fuel.core.Request request$default(com.github.kittinunf.fuel.Fuel$Companion,com.github.kittinunf.fuel.core.Method,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
com.github.kittinunf.fuel.Fuel$Companion$regularMode$1
com.github.kittinunf.fuel.Fuel$Companion$testMode$1
com.github.kittinunf.fuel.Fuel$PathStringConvertible
com.github.kittinunf.fuel.FuelKt:
    public static com.github.kittinunf.fuel.core.Request httpGet(java.lang.String)
    131:131:public static final com.github.kittinunf.fuel.core.Request httpGet(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    130:130:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpGet$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpGet(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    public static com.github.kittinunf.fuel.core.Request httpPost(java.lang.String)
    141:141:public static final com.github.kittinunf.fuel.core.Request httpPost(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    140:140:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpPost$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpPost(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    146:146:public static final com.github.kittinunf.fuel.core.Request httpPut(java.lang.String,java.util.List)
    145:145:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpPut$default(java.lang.String,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpPut(java.lang.String)
    151:151:public static final com.github.kittinunf.fuel.core.Request httpPut(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    150:150:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpPut$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpPut(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    156:156:public static final com.github.kittinunf.fuel.core.Request httpDelete(java.lang.String,java.util.List)
    155:155:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpDelete$default(java.lang.String,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpDelete(java.lang.String)
    161:161:public static final com.github.kittinunf.fuel.core.Request httpDelete(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    160:160:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpDelete$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpDelete(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    166:166:public static final com.github.kittinunf.fuel.core.Request httpDownload(java.lang.String,java.util.List)
    165:165:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpDownload$default(java.lang.String,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpDownload(java.lang.String)
    171:171:public static final com.github.kittinunf.fuel.core.Request httpDownload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    170:170:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpDownload$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpDownload(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    176:176:public static final com.github.kittinunf.fuel.core.Request httpUpload(java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List)
    175:175:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpUpload$default(java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpUpload(java.lang.String,com.github.kittinunf.fuel.core.Method)
    public static com.github.kittinunf.fuel.core.Request httpUpload(java.lang.String)
    181:181:public static final com.github.kittinunf.fuel.core.Request httpUpload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method,java.util.List)
    180:180:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpUpload$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpUpload(com.github.kittinunf.fuel.Fuel$PathStringConvertible,com.github.kittinunf.fuel.core.Method)
    public static com.github.kittinunf.fuel.core.Request httpUpload(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    186:186:public static final com.github.kittinunf.fuel.core.Request httpHead(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    185:185:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpHead$default(com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpHead(com.github.kittinunf.fuel.Fuel$PathStringConvertible)
    191:191:public static final com.github.kittinunf.fuel.core.Request httpHead(java.lang.String,java.util.List)
    190:190:public static bridge synthetic com.github.kittinunf.fuel.core.Request httpHead$default(java.lang.String,java.util.List,int,java.lang.Object)
    public static com.github.kittinunf.fuel.core.Request httpHead(java.lang.String)
com.github.kittinunf.fuel.android.BuildConfig
com.github.kittinunf.fuel.android.core.Json:
    6:6:public final java.lang.String getContent()
com.github.kittinunf.fuel.android.extension.RequestsKt:
    11:11:public static final com.github.kittinunf.fuel.core.Request responseJson(com.github.kittinunf.fuel.core.Request,com.github.kittinunf.fuel.core.Handler)
    13:13:public static final kotlin.Triple responseJson(com.github.kittinunf.fuel.core.Request)
com.github.kittinunf.fuel.android.util.AndroidEnvironment
com.github.kittinunf.fuel.android.util.AndroidEnvironment$callbackExecutor$1
com.github.kittinunf.fuel.core.DefaultEnvironment:
    18:18:public void setCallbackExecutor(java.util.concurrent.Executor)
com.github.kittinunf.fuel.core.DeserializableKt:
    43:48:public static final com.github.kittinunf.fuel.core.Request response(com.github.kittinunf.fuel.core.Request,com.github.kittinunf.fuel.core.Deserializable,com.github.kittinunf.fuel.core.Handler)
com.github.kittinunf.fuel.core.DeserializableKt$response$3
com.github.kittinunf.fuel.core.DeserializableKt$response$4
com.github.kittinunf.fuel.core.Encoding:
    14:14:public final void setRequestType(com.github.kittinunf.fuel.core.Request$Type)
    16:16:public final java.lang.String getBaseUrlString()
    20:20:public final void setEncoder(kotlin.jvm.functions.Function3)
com.github.kittinunf.fuel.core.Environment:
    public abstract void setCallbackExecutor(java.util.concurrent.Executor)
com.github.kittinunf.fuel.core.FuelError:
    7:7:public final byte[] getErrorData()
com.github.kittinunf.fuel.core.FuelManager:
    public final void setClient(com.github.kittinunf.fuel.core.Client)
    18:18:public final java.lang.String getBasePath()
    18:18:public final void setBasePath(java.lang.String)
    21:21:public final java.util.List getBaseParams()
    21:21:public final void setBaseParams(java.util.List)
    23:23:public final void setKeystore(java.security.KeyStore)
    public final void setSocketFactory(javax.net.ssl.SSLSocketFactory)
    public final void setHostnameVerifier(javax.net.ssl.HostnameVerifier)
    public final void setExecutor(java.util.concurrent.ExecutorService)
    public final void setCallbackExecutor(java.util.concurrent.Executor)
    58:58:public static bridge synthetic com.github.kittinunf.fuel.core.Request request$default(com.github.kittinunf.fuel.core.FuelManager,com.github.kittinunf.fuel.core.Method,java.lang.String,java.util.List,int,java.lang.Object)
    77:77:public final com.github.kittinunf.fuel.core.Request request(com.github.kittinunf.fuel.core.Method,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List)
    76:76:public static bridge synthetic com.github.kittinunf.fuel.core.Request request$default(com.github.kittinunf.fuel.core.FuelManager,com.github.kittinunf.fuel.core.Method,com.github.kittinunf.fuel.Fuel$PathStringConvertible,java.util.List,int,java.lang.Object)
    81:167:public final com.github.kittinunf.fuel.core.Request download(java.lang.String,java.util.List)
    80:80:public static bridge synthetic com.github.kittinunf.fuel.core.Request download$default(com.github.kittinunf.fuel.core.FuelManager,java.lang.String,java.util.List,int,java.lang.Object)
    100:167:public final com.github.kittinunf.fuel.core.Request upload(java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List)
    99:99:public static bridge synthetic com.github.kittinunf.fuel.core.Request upload$default(com.github.kittinunf.fuel.core.FuelManager,java.lang.String,com.github.kittinunf.fuel.core.Method,java.util.List,int,java.lang.Object)
    131:132:public final void addRequestInterceptor(kotlin.jvm.functions.Function1)
    135:136:public final void addResponseInterceptor(kotlin.jvm.functions.Function1)
    139:140:public final void removeRequestInterceptor(kotlin.jvm.functions.Function1)
    143:144:public final void removeResponseInterceptor(kotlin.jvm.functions.Function1)
    147:148:public final void removeAllRequestInterceptors()
    151:152:public final void removeAllResponseInterceptors()
    15:15:public static final synthetic void access$setInstance$cp(kotlin.properties.ReadWriteProperty)
com.github.kittinunf.fuel.core.FuelManager$Companion:
    public final void setInstance(com.github.kittinunf.fuel.core.FuelManager)
com.github.kittinunf.fuel.core.FuelManager$download$1
com.github.kittinunf.fuel.core.FuelManager$download$3
com.github.kittinunf.fuel.core.FuelManager$upload$1
com.github.kittinunf.fuel.core.FuelManager$upload$3
com.github.kittinunf.fuel.core.Handler
com.github.kittinunf.fuel.core.HttpException:
    3:3:public final int getHttpCode()
    3:3:public final java.lang.String getHttpMessage()
com.github.kittinunf.fuel.core.Request:
    29:29:public final void setTimeoutInMillisecond(int)
    30:30:public final void setTimeoutReadInMillisecond(int)
    34:34:public final java.lang.String getPath()
    49:49:public final java.util.concurrent.Future getTaskFuture()
    49:49:public final void setTaskFuture(java.util.concurrent.Future)
    56:56:public final java.util.concurrent.ExecutorService getExecutor()
    57:57:public final java.util.concurrent.Executor getCallbackExecutor()
    65:66:public final com.github.kittinunf.fuel.core.Request timeout(int)
    70:71:public final com.github.kittinunf.fuel.core.Request timeoutRead(int)
    75:242:public final varargs com.github.kittinunf.fuel.core.Request header(kotlin.Pair[])
    82:82:public final com.github.kittinunf.fuel.core.Request header(java.util.Map)
    103:105:public final com.github.kittinunf.fuel.core.Request authenticate(java.lang.String,java.lang.String)
    109:123:public final com.github.kittinunf.fuel.core.Request progress(kotlin.jvm.functions.Function2)
    127:132:public final com.github.kittinunf.fuel.core.Request source(kotlin.jvm.functions.Function2)
    136:141:public final com.github.kittinunf.fuel.core.Request destination(kotlin.jvm.functions.Function2)
    145:148:public final com.github.kittinunf.fuel.core.Request interrupt(kotlin.jvm.functions.Function1)
    162:163:public final void cancel()
    169:190:public final java.lang.String cUrlString()
    210:210:public final com.github.kittinunf.fuel.core.Request response(kotlin.jvm.functions.Function3)
    212:212:public final com.github.kittinunf.fuel.core.Request response(com.github.kittinunf.fuel.core.Handler)
    220:220:public final com.github.kittinunf.fuel.core.Request responseString(java.nio.charset.Charset,com.github.kittinunf.fuel.core.Handler)
    222:222:public final com.github.kittinunf.fuel.core.Request responseString(com.github.kittinunf.fuel.core.Handler)
    224:224:public final kotlin.Triple responseString(java.nio.charset.Charset)
    224:224:public static bridge synthetic kotlin.Triple responseString$default(com.github.kittinunf.fuel.core.Request,java.nio.charset.Charset,int,java.lang.Object)
    227:227:public final com.github.kittinunf.fuel.core.Request responseObject(com.github.kittinunf.fuel.core.ResponseDeserializable,kotlin.jvm.functions.Function3)
    229:229:public final com.github.kittinunf.fuel.core.Request responseObject(com.github.kittinunf.fuel.core.ResponseDeserializable,com.github.kittinunf.fuel.core.Handler)
    231:231:public final kotlin.Triple responseObject(com.github.kittinunf.fuel.core.ResponseDeserializable)
com.github.kittinunf.fuel.core.Request$Companion:
    236:236:public static bridge synthetic com.github.kittinunf.fuel.core.deserializers.StringDeserializer stringDeserializer$default(com.github.kittinunf.fuel.core.Request$Companion,java.nio.charset.Charset,int,java.lang.Object)
com.github.kittinunf.fuel.core.Response:
    7:7:public final java.net.URL getUrl()
com.github.kittinunf.fuel.core.ResponseDeserializable
com.github.kittinunf.fuel.core.ResponseDeserializable$DefaultImpls
com.github.kittinunf.fuel.core.deserializers.StringDeserializer:
    7:7:public final java.nio.charset.Charset getCharset()
com.github.kittinunf.fuel.core.interceptors.LoggingInterceptorsKt
com.github.kittinunf.fuel.core.interceptors.LoggingInterceptorsKt$cUrlLoggingRequestInterceptor$1
com.github.kittinunf.fuel.core.interceptors.LoggingInterceptorsKt$cUrlLoggingRequestInterceptor$1$1
com.github.kittinunf.fuel.core.interceptors.LoggingInterceptorsKt$loggingInterceptor$1
com.github.kittinunf.fuel.core.interceptors.LoggingInterceptorsKt$loggingInterceptor$1$1
com.github.kittinunf.fuel.core.requests.AsyncTaskRequest:
    8:8:public final kotlin.jvm.functions.Function1 getSuccessCallback()
    9:9:public final kotlin.jvm.functions.Function2 getFailureCallback()
    6:6:public final com.github.kittinunf.fuel.core.requests.TaskRequest getTask()
com.github.kittinunf.fuel.core.requests.DownloadTaskRequest:
    14:14:public final int getBUFFER_SIZE()
    16:16:public final void setProgressCallback(kotlin.jvm.functions.Function2)
    17:17:public final kotlin.jvm.functions.Function2 getDestinationCallback()
    17:17:public final void setDestinationCallback(kotlin.jvm.functions.Function2)
    19:19:public final java.io.InputStream getDataStream()
    19:19:public final void setDataStream(java.io.InputStream)
    20:20:public final java.io.FileOutputStream getFileOutputStream()
    20:20:public final void setFileOutputStream(java.io.FileOutputStream)
com.github.kittinunf.fuel.core.requests.TaskRequest:
    12:12:public final kotlin.jvm.functions.Function1 getInterruptCallback()
    12:12:public final void setInterruptCallback(kotlin.jvm.functions.Function1)
com.github.kittinunf.fuel.core.requests.UploadTaskRequest:
    15:15:public final int getBUFFER_SIZE()
    17:17:public final java.lang.String getCRLF()
    18:18:public final java.lang.String getBoundary()
    20:20:public final void setProgressCallback(kotlin.jvm.functions.Function2)
    21:21:public final kotlin.jvm.functions.Function2 getSourceCallback()
    21:21:public final void setSourceCallback(kotlin.jvm.functions.Function2)
    23:23:public final java.io.ByteArrayOutputStream getDataStream()
    23:23:public final void setDataStream(java.io.ByteArrayOutputStream)
    24:24:public final java.io.FileInputStream getFileInputStream()
    24:24:public final void setFileInputStream(java.io.FileInputStream)
com.github.kittinunf.fuel.util.Base64
com.github.kittinunf.fuel.util.Base64$Coder
com.github.kittinunf.fuel.util.Base64$Decoder
com.github.kittinunf.fuel.util.Base64$Encoder
com.github.kittinunf.fuel.util.InputStreamsKt:
    6:6:public static bridge synthetic long copyTo$default(java.io.InputStream,java.io.OutputStream,int,kotlin.jvm.functions.Function1,int,java.lang.Object)
com.github.kittinunf.fuel.util.TestConfiguration:
    9:9:public final void setTimeout(java.lang.Integer)
    15:15:public final void setTimeoutRead(java.lang.Integer)
    20:20:public final void setBlocking(boolean)
    public final java.lang.Integer component1()
    public final java.lang.Integer component2()
    public final boolean component3()
    public final com.github.kittinunf.fuel.util.TestConfiguration copy(java.lang.Integer,java.lang.Integer,boolean)
    public static bridge synthetic com.github.kittinunf.fuel.util.TestConfiguration copy$default(com.github.kittinunf.fuel.util.TestConfiguration,java.lang.Integer,java.lang.Integer,boolean,int,java.lang.Object)
com.github.kittinunf.result.NoException
com.github.kittinunf.result.Result:
    public abstract java.lang.Object component1()
    public abstract java.lang.Exception component2()
com.github.kittinunf.result.Result$Companion:
    98:109:public final com.github.kittinunf.result.Result of(java.lang.Object,kotlin.jvm.functions.Function0)
    97:97:public static bridge synthetic com.github.kittinunf.result.Result of$default(com.github.kittinunf.result.Result$Companion,java.lang.Object,kotlin.jvm.functions.Function0,int,java.lang.Object)
com.github.kittinunf.result.Result$Companion$of$1
com.github.kittinunf.result.Result$Failure:
    76:76:public java.lang.Object component1()
    77:77:public java.lang.Exception component2()
com.github.kittinunf.result.Result$Success:
    57:57:public java.lang.Object component1()
    58:58:public java.lang.Exception component2()
com.github.kittinunf.result.ResultKt
com.github.kittinunf.result.ResultKt$failure$1
com.github.kittinunf.result.ResultKt$success$1

I'll try and spend some time seeing if some more direct rules fix the problem.

Consider migrate response handler as interface

When use Fuel with Java, it needs to resort to use jvm.functions package to convert lambda into an interface.

Fuel.Companion.get("http://httpbin.org/get", params).responseString(new Function3<Request, Response, Either<FuelError, String>, Unit>() {
    @Override
    public Unit invoke(Request request,
                       Response response,
                       Either<FuelError, String> fuelErrorStringEither) {
        updateUI(fuelErrorStringEither);
        return null;
    }
});

Hangs on at exit

Hangs on at exit when using async mode,

Fuel.get("http://www.google.com/").responseString { request, response, result ->
        println(result.getAs<String>())
    }

FuelManager.instance.executor.shutdown() // this line fixes problem

Follow redirections

I recently used Fuel and received a 301 Moved permanently from the server with an other url in the Location header.

It would be nice if Fuel handles that kind of http codes and performs a second request automatically (or maybe when a specific parameter is enabled in Manager.instance).

Can upload a file with params ?

Dear kittinunf:
I want to upload a file with some params,such as user_id.
I used like these, but the server can't get user_id.

    url.httpUpload(Method.POST,params)
            .source {
                request, url ->
                return@source file
            }
            .responseJson {
                request, response, result ->

    }

App:dexDebug?

Hello,
First of all, thanks for this awesome lib, it's really hard to find something clean and flexible.

I create a whole web service api using this lib but, when I try to run the app, this happens:

**Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2**

I'm using Gradle to import the lib and, if I remove the dependency, the app works.
Do you have any idea?

Thank you!
Best wishes;

Need Fuel.upload() with HTTP PUT

When tested Fuel.upload() to upload an image to amazon s3, it failed, possibly because of http method as the upload succeeded with Fuel.put()

Let params override baseParams

I think it makes more sense to let params override baseParams instead of the current implementation which defaults to baseParams if present. For me baseParams define the default but I would like to make an exeception in specific calls. Thus instead of doing params + baseParams I think it should be baseParams + params.

What doe you think?

Manager

Hi guys!
First of all, well done for this very convenient library! Really cool to use :)
But I'm not super fan of the Manager, I don't like the static but it's super convenient here so ok, but the name...
Is it possible to rename it FuelManager or something like this?

Testing Mode Delay

Is there any way to add a delay in the request in order to test in an Android app.
For example i make the call

Request request = Fuel.delete(URL); request.responseString(listener);

and wait at least a few seconds until get the response.

Possibly incorrect links in Readme

In this commit, you have used github urls that refer to the master branch, as opposed to a specific git blob thing. eg compare these urls:

https://github.com/kittinunf/Fuel/blob/master/fuel/build.gradle
https://github.com/kittinunf/Fuel/blob/f73de4ffd94498d4369f96f84f96a7062218ada9/fuel-android/build.gradle

The 2nd one points to build.gradle at a specific point in time, whereas the 1st one points to the most recent version, which can change.
As a result, I think the "fold" and "multiple declare" links in the Readme are pointing to the incorrect lines. I think.

Progress not updating

Hi
i want update progress of ProgressDialog in progress method in download
but progress not updating on view , im seeing the percent in logcat

progress=new ProgressDialog(activity);
progress.setMessage(activity.getResources().getString(R.string.download_video));
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progress.setIndeterminate(true);
progress.setProgress(0);
progress.setMax(100);
progress.setIndeterminate(false);
progress.show();

and in progress

int currentProgress = (int)(readBytes * 100.0 / totalBytes + 0.5);
Log.d(BadansazApplication.TAG, "download Pogress :"+String.valueOf(currentProgress));
progress.setProgress(currentProgress);

Add support OkHttp library

As OkHttp has many advantages and there a lot of Android applications already use OkHttp. Should this library supports OkHttp as a plugin or uses it directly?

TimeoutExcpetion is synchronized requests

Sync() method and timeout

Given the following code:

Fuel.get("https://www.google.co.il").sync().timeout(5000).responseString { request, response, result ->
            println("Received; Start sleeping for 5 seconds.")
            Thread.sleep(5000)
            println("Done")
        }

The result is:

Received; Start sleeping for 5 seconds.
Exception in thread "main" java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
    at com.github.kittinunf.fuel.core.DeserializableKt.response(Deserializable.kt:78)
    at com.github.kittinunf.fuel.core.DeserializableKt.response(Deserializable.kt:35)
    at com.github.kittinunf.fuel.core.Request.responseString(Request.kt:223)
    at com.github.kittinunf.fuel.core.Request.responseString$default(Request.kt:222)
    at com.yoavst.testing.fuel.SyncMethodBug.run(SyncMethodBug.kt:8)
    at com.yoavst.testing.MainKt.main(main.kt:7)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Done

Bug info

This Code is responsible on this bug. The timeout is being applied twice for sync(), once in HttpClient and here.

So the question is - is it duplicated for a reason, or it is just a bug?

Update Result lib version

Result 0.4

New features:

//success
result.success {
}

//failure
result.failure {
}

Notice

We can probably delay it until Kotlin 1.0 RC get out of EAP, so this is just a reminder.

Calling PUT from Android is returning empty Response

Hi, I'm making a PUT call in this form:

val (request, response, result) = Fuel.put("/myApiUrl/$id?access_token=$token", listOf("param1" to value1).header(Pair("Content-Type", "application/x-www-form-urlencoded")).response()

Before anyone asks, I'm adding manually the Content-Type in the header because if I don't it is not automatically added despite what the documentation says.

Anyway, the response I debug has a length of 0. The Body is empty. But if I print the cUrlString and I execute it from the command line it works. I get what I'm expecting. Can you help me please? There is some known issue with Android?

Thank you very much.

Way to retrieve redirection info

I understand that auto redirection is implemented in #40, but how can I disable this? My use case is that I want to decide whether or not to redirect based on the Location header, but with auto-redirection I can only see the final response.

An alternative would be that I can in some way check where I have beed redirected to. But this also seems impossible—It seems to me URLs of both request and response in the callback are set to the original URL I requested from, not the final one that actually returns the non-redirection status.

Android: empty response when using POST

No matter what I do I always get an empty response.

This is the dependency I'm using compile 'com.github.kittinunf.fuel:fuel-android:1.2.1'

        FuelManager.instance.basePath = resources.getString(R.string.url_server)

        Fuel.post("/auth/login",listOf("password" to "XXXX", "username" to "XXXX")).responseString { request, response, result ->
            Log.d("REQUEST", request.cUrlString())

            val (data, error) = result
            if (error != null) {
                Log.d("RESPONSE", response.toString())
            } else {
                //error handling
            }
        }

This is the response I get (I've obscured the URL)

RESPONSE: <-- -1 (https://XXXXXX)
                                             Response : 
                                             Length : 0
                                             Body : (empty)
                                             Headers : (0)

I've pasted the cURL request string request.cUrlString() into terminal and I do get this response

HTTP/1.1 200 OK
Server: nginx
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache
Date: Thu, 12 May 2016 19:10:23 GMT

{"data":{"jwt":"eyJ0eXAiOiJKV1QiLXbGciOiJIUzUxMiJ9.eyJpc3MiOiJodHRwczpcL1wvd3d3LmFzY2MubWUiLCJpYXQiOjE0NjMwODAyMjMsIm5iZiI6MTQ2MzA4MDIyNCwiZXhwIjoxNDYzMDgzODI0LCJkYXRhIjp7InVzZXJfaWQiOjEsInVzZXJuYX1lIjoieW9kYV9mdHciLCJuYW1lIjoiR3JhbmQgSmVkaSBNYXN0ZXIgWW9kYSIsInR5cGUiOiJhZG1pbiJ9fX.ITW8_n-HyX3Q9wUeNoKeChOcv9SUNs4NsMNqyX9PcxsCnaTd0B4R04BFJamawa94Fh0vSES429ACP6SDQcj5ug"}}

Am I missing something?

Allow setting timeout on FuelManager

Atm, the timeouts are hardcoded here. It would be nice to be able to modify the timeout for all requests on the FuelManager.instance object, rather than having to manually configure the timeout for each request.

Non Android support

Is it planned? Currently it requires to use robolectric to test api calls.
From a quick view (running without roboelectric) you use android's Uri class. Is there any alternative?

Accept `java.net.URL` as PathStringConvertible

In my code I'm using java.net.URL to store URLs, but I need to convert them into string to pass them in to Fuel.

    val authUrl = URL(BASE, "/cloverapi/app")
    Fuel.post(authUrl)
Error:(147, 14) None of the following functions can be called with the arguments supplied:
@kotlin.jvm.JvmStatic @kotlin.jvm.JvmOverloads public final fun post(convertible: com.github.kittinunf.fuel.Fuel.PathStringConvertible, parameters: kotlin.collections.List<kotlin.Pair<kotlin.String, kotlin.Any?>>? = ...): com.github.kittinunf.fuel.core.Request defined in com.github.kittinunf.fuel.Fuel.Companion
@kotlin.jvm.JvmStatic @kotlin.jvm.JvmOverloads public final fun post(path: kotlin.String, parameters: kotlin.collections.List<kotlin.Pair<kotlin.String, kotlin.Any?>>? = ...): com.github.kittinunf.fuel.core.Request defined in com.github.kittinunf.fuel.Fuel.Companion

It would be great if I could pass a URL to the post function without having to convert to string.

I'm using URLs to give me extra integrity checks versus using strings.

Maven Central?

Any plans to release this to Maven Central? That way I can write some Kovenant extensions for this.

Headers not sticking

I don't know if I'm doing something wrong here but I can't seem to get my header changes to stick.

Here's what I'm doing:

Manager.instance.baseHeaders = mapOf(Pair("Content-Type", "application/json"))
val (request, response, data) = url.httpPost(listOf(Pair("emailAddress", email))).responseString()

However, when I debug the Manager class' request method (around line 57) the request's headers are set to:

"Content-Type" -> "application/x-www-form-urlencoded"
"Accept-Encoding" -> "compress;q=0.5, gzip;q=1.0"

This is using just Fuel (not the android lib) in a Spring Boot app with the Kotlin RC

Check file

Hi!
As you can quickly check the availability of a file on the server?
Very slow:

                        Fuel.get("http://samlib.ru/k/kerr_r/strashnyjson.fb2.zip").timeout(Constants.USER_TIMEOUT_FAST).responseString(new Handler<String>() {
                            @Override
                            public void failure(Request request, Response response, FuelError error) {
                                //do something when it is failure
                                func.showLog("failure");
                                func.showLog_int(response.getHttpStatusCode());
                            }

                            @Override
                            public void success(Request request, Response response, String data) {
                                //do something when it is successful
                                func.showLog("success");
                                func.showLog_int(response.getHttpStatusCode());
                            }
                        });

Can we post hashMapOf?

What's the recommended way to post a hashMapOf literal.

Like so

val payload = hashMapOf("username" to username, "password" to password)

Fuel.post(url).body(payload)

But it only seems to take a byte array.

Caching

Especially on android, having a builtin caching layer would be v. useful.

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.