I'm trying to use fuel http request library and ju...
# android
j
I'm trying to use fuel http request library and just found out it does't support PATCH requests.... It's supposed to send an X-HTTP-Method-Override inside the header to my server (django) but my servers never getting it...
😶 3
Copy code
private fun patchRequest(user: FinUser, url: String, header: OverRideHeader, jsonBody: String,
                         onCompletion: (FinUser, MutableMap<String,Any>) -> Unit,
                         onError:  (FinUser, MutableMap<String,Any>) -> Unit){
    var request = Fuel.patch(url).body(jsonBody).header(header.content, header.contentValue)
    if(header.authorizationValue != ""){
        request.header(header.authorization, header.authorizationValue)
    }
    request.header(header.overRide, header.overRideValue)
    request.responseString { request, response, result ->
        responseHandle(user = user, request = request, response = response, result = result,
            onCompletion = onCompletion, onError = onError) }
}
I've even tried adding it into my header but no avail...
Think I found the issue https://www.django-rest-framework.org/topics/browser-enhancements/ looks like django wants
Copy code
METHOD_OVERRIDE_HEADER = 'HTTP_X_HTTP_METHOD_OVERRIDE'
Nvm still doesn't work...