postInstance Method

Post a strongly typed instance. Sends a request body with a WSG instance.

postInstance<T extends WsgInstance<T>>(requestContext: AuthorizedClientRequestContext, typedConstructor: () => T, relativeUrlPath: string, instance: T, requestOptions?: WsgRequestOptions, httpRequestOptions?: HttpRequestOptions): Promise<T>

Parameter Type Description
requestContext AuthorizedClientRequestContext The client request context
typedConstructor () => T Used to construct the resulting instances from the response.
relativeUrlPath string Relative path to the REST resource.
instance T Strongly typed instance to be posted.
requestOptions WsgRequestOptions WSG options for the request.
httpRequestOptions HttpRequestOptions Additional options for the HTTP request.

Returns - Promise<T>

The posted instance that's returned back from the server.

Defined in

Last Updated: 12 June, 2024