Commit Graph

17 Commits

Author SHA1 Message Date
Zahary Karadjov 80ebc5b419
Allow the 'api' macro to be used in generic functions 2022-01-06 20:20:20 +02:00
Zahary Karadjov fba35d5a67 Add support for passing extra headers in HTTP requests 2021-12-22 08:00:51 +02:00
Eugene Kabanov c41bc8aefc
Add router.rawApi() macro and tests. (#17) 2021-11-29 17:14:10 +02:00
Etan Kissling bfcbeceb65
allow reserved Nim keywords as REST params (#15)
This resolves a compilation error when specifying a reserved Nim keyword
as a REST parameter. The error was `node lacks field: strVal`, as the
corresponding identifiers need backticks embedding, e.g., `` `let` ``,
requiring an additional unwrap of `nnkAccQuoted` to get the raw ident.
2021-10-28 19:00:14 +03:00
Eugene Kabanov 9a7e711e22
Add Accept handling to REST server and client. (#12)
* Add Accept handling to REST server and client.
Add proper tests to server and client's test suites.
Fix some warnings.
Bump some nimble dependencies.

* Remove debugging echo.
2021-09-07 13:28:56 +03:00
Eugene Kabanov 5163805723
Add flag to pass comma delimited arrays by REST client. (#8)
Simplify server array decoding.
Add tests for comma delimited arrays.
2021-05-18 00:42:35 +03:00
Eugene Kabanov 80e28d15d6
Custom Response types introduced RestStatus, RestResponse[T], RestPlainResponse. (#5)
Added tests.
2021-05-11 18:31:43 +03:00
Eugene Kabanov d0ed144b9c
Rest client (#3)
* Separate some macro helper procedures to common module.
Initial commit for client.

* Arguments pre-processing and createPath() with tests.

* Further progress on arguments.

* Add method checks.

* REST client release candidate.

* Add redirection support to client requests.
Move all network logic to procedures.
Add first test.
Add PrestoIdent default to REST server and client.

* Add agent.

* Fix url encoding in request's path.

* Fix client url-encoding handling.
RestApiResponse become case-object.
Make `-d:nimDumpRest` the only one dumping procedure.
Add rest client tests.

* Add logging support.

* Bump chronos dependency version.
2021-05-10 11:28:58 +03:00
cheatfate 991b5836f6
Add `redirect` macro to allow path redirection.
Add tests for `redirect` macro.
Add check for unique patterns in path and tests.
2021-04-13 11:56:21 +03:00
cheatfate 2f01c838c6
Finally address comment about processRestRequest().
Fix compiler warning for testbtrees.
2021-03-25 10:35:58 +02:00
cheatfate 6687601ebb
Address review comments part 1. 2021-03-25 00:29:56 +02:00
cheatfate 32085aa97b
Add SecureRestServer implementation and tests. 2021-03-24 15:52:11 +02:00
cheatfate f2a51369d2
Change REST api error response to custom message with custom content-type. 2021-03-11 14:31:14 +02:00
cheatfate a61baae44c
Fix 32bit issues in tests. 2021-03-02 20:18:44 +02:00
cheatfate 1b94fe21dd
Fix one more path problem. 2021-03-02 16:58:07 +02:00
cheatfate d88d6471a8
Fix path problem. 2021-03-02 16:00:51 +02:00
cheatfate 9c9b061158
Initial implementation for review. 2021-03-02 15:50:16 +02:00