aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Bertin <marvin.bertin@gmail.com>2018-01-09 14:58:51 -0800
committerGitHub <noreply@github.com>2018-01-09 14:58:51 -0800
commit199446c2f878992be2a21a00a9263b6330738151 (patch)
treec96c3f6253d8964fc547abf0a3d675152854602e
parent16e99b65e18a7e9a0695c8400f3b59c9f0523de0 (diff)
parent15e60279c12eae22d6804ca094ce5f796daaed2c (diff)
downloaddriver-core-199446c2f878992be2a21a00a9263b6330738151.tar.gz
driver-core-199446c2f878992be2a21a00a9263b6330738151.tar.bz2
driver-core-199446c2f878992be2a21a00a9263b6330738151.zip
Merge pull request #101 from drivergroup/trial-189-add-put-patch-responsesv1.6.12
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))