mirror of https://github.com/waku-org/nwaku.git
35 lines
703 B
Nim
35 lines
703 B
Nim
when (NimMajor, NimMinor) < (1, 4):
|
|
{.push raises: [Defect].}
|
|
else:
|
|
{.push raises: [].}
|
|
|
|
import
|
|
json,
|
|
std/sets,
|
|
stew/byteutils,
|
|
strformat,
|
|
chronicles,
|
|
json_serialization,
|
|
json_serialization/std/options,
|
|
presto/[route, client, common]
|
|
import
|
|
../../../waku_core,
|
|
../serdes,
|
|
../responses,
|
|
../rest_serdes,
|
|
./types
|
|
|
|
export types
|
|
|
|
logScope:
|
|
topics = "waku node rest client v2"
|
|
|
|
proc encodeBytes*(value: PushRequest,
|
|
contentType: string): RestResult[seq[byte]] =
|
|
return encodeBytesOf(value, contentType)
|
|
|
|
|
|
proc sendPushRequest*(body: PushRequest):
|
|
RestResponse[string]
|
|
{.rest, endpoint: "/lightpush/v1/message", meth: HttpMethod.MethodPost.}
|