@delight-rpc/http-client v9.0.5
@delight-rpc/http-client
The HTTP client library of delight-rpc, it needs to be used with the server implementation @delight-rpc/http-server.
Install
npm install --save @delight-rpc/http-client
# or
yarn add @delight-rpc/http-client
Usage
interface IAPI {
echo(message: string): string
}
const client = createClient<IAPI>({
server: 'http://localhost:8080'
, keepalive: true
})
await client.echo('hello')
API
interface IClientOptions {
server: string
timeout?: number
keepalive?: boolean
basicAuth?: {
username: string
password: string
}
}
createClient
function createClient<IAPI extends object>(
clientOptions: IClientOptions
, options?: {
parameterValidators?: DelightRPC.ParameterValidators<IAPI>
expectedVersion?: string
channel?: string
}
): DelightRPC.ClientProxy<IAPI>
createBatchClient
function createBatchClient(
clientOptions: IClientOptions
, options?: {
expectedVersion?: string
channel?: string
}
): DelightRPC.BatchClient
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago