Does anyone know why the Android engine in Ktor cl...
# ktor
c
Does anyone know why the Android engine in Ktor client doesn’t support PATCH? It works with OkHttp engine It doesn’t even make the call, it just fails with:
REQUEST failed with exception: java.net.ProtocolException: Invalid HTTP method: PATCH
Seems like HttpURLConnection doesn’t support it, hmm.
a
You can try to use the X-HTTP-Method-Override header as a workaround.
c
Yes, that works, thanks 🙂 I think I’ll just switch to OkHttp though
c
You should be able to make up your own HTTP verbs. That's the spec. RFC 7231 (HTTP/1.1) explicitly allows new methods:
"A client is not limited to the methods defined by this specification. When a request method is unknown, the origin server SHOULD respond with 501 (Not Implemented)."
RFC 7231 §4.1