diff options
author | Marvin Bertin <marvin.bertin@gmail.com> | 2018-01-09 14:30:15 -0800 |
---|---|---|
committer | Marvin Bertin <marvin.bertin@gmail.com> | 2018-01-09 14:30:15 -0800 |
commit | 15e60279c12eae22d6804ca094ce5f796daaed2c (patch) | |
tree | c96c3f6253d8964fc547abf0a3d675152854602e /src/main/scala/xyz/driver/core/rest | |
parent | 16e99b65e18a7e9a0695c8400f3b59c9f0523de0 (diff) | |
download | driver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.tar.gz driver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.tar.bz2 driver-core-15e60279c12eae22d6804ca094ce5f796daaed2c.zip |
add PUT and PATCH responses to RestService Trait
Diffstat (limited to 'src/main/scala/xyz/driver/core/rest')
-rw-r--r-- | src/main/scala/xyz/driver/core/rest/RestService.scala | 12 |
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)) |