aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2018-01-09 14:30:15 -0800
committerMarvin Bertin <marvin.bertin@gmail.com>2018-01-09 14:30:15 -0800
commit15e60279c12eae22d6804ca094ce5f796daaed2c (patch)
treec96c3f6253d8964fc547abf0a3d675152854602e
parent16e99b65e18a7e9a0695c8400f3b59c9f0523de0 (diff)
downloaddriver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.tar.gz
driver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.tar.bz2
driver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.zip
add PUT and PATCH responses to RestService Trait
-rw-r--r--src/main/scala/xyz/driver/core/rest/RestService.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/rest/RestService.scala b/src/main/scala/xyz/driver/core/rest/RestService.scala
index c1d883a..3cb66f9 100644
--- a/src/main/scala/xyz/driver/core/rest/RestService.scala
+++ b/src/main/scala/xyz/driver/core/rest/RestService.scala
@@ -43,6 +43,18 @@ trait RestService extends Service {
protected def postJson(baseUri: Uri, path: String, json: JsValue) =
HttpRequest(HttpMethods.POST, endpointUri(baseUri, path), entity = jsonEntity(json))
+ protected def put(baseUri: Uri, path: String, httpEntity: RequestEntity) =
+ HttpRequest(HttpMethods.PUT, endpointUri(baseUri, path), entity = httpEntity)
+
+ protected def putJson(baseUri: Uri, path: String, json: JsValue) =
+ HttpRequest(HttpMethods.PUT, endpointUri(baseUri, path), entity = jsonEntity(json))
+
+ protected def patch(baseUri: Uri, path: String, httpEntity: RequestEntity) =
+ HttpRequest(HttpMethods.PATCH, endpointUri(baseUri, path), entity = httpEntity)
+
+ protected def patchJson(baseUri: Uri, path: String, json: JsValue) =
+ HttpRequest(HttpMethods.PATCH, endpointUri(baseUri, path), entity = jsonEntity(json))
+
protected def delete(baseUri: Uri, path: String) =
HttpRequest(HttpMethods.DELETE, endpointUri(baseUri, path))