Changeset View
Changeset View
Standalone View
Standalone View
src/main/java/net/wildfyre/http/Method.kt
Show All 18 Lines | |||||
import java.net.HttpURLConnection | import java.net.HttpURLConnection | ||||
import java.net.ProtocolException | import java.net.ProtocolException | ||||
/** | /** | ||||
* The HTTP method used to connect to the server. | * The HTTP method used to connect to the server. | ||||
* | * | ||||
* This class is NOT part of the public API. | * This class is NOT part of the public API. | ||||
*/ | */ | ||||
internal enum class Method { | enum class Method { | ||||
/** Change parts of the resource. */ | /** Change parts of the resource. */ | ||||
PATCH { | PATCH { | ||||
override fun setMethod(conn: HttpURLConnection, req: Request) { | override fun setMethod(conn: HttpURLConnection, req: Request) { | ||||
PUT.setMethod(conn, req) | PUT.setMethod(conn, req) | ||||
req.headers["X-HTTP-Method-Override"] = name | req.headers["X-HTTP-Method-Override"] = name | ||||
} | } | ||||
}, | }, | ||||
Show All 30 Lines |