udServerAPI

The udServerAPI module provides an interface to communicate with a Nuclideon udServer API directly in a simple fashion.

Functions

enum udError udServerAPI_Query(struct udContext *pContext, const char *pAPIAddress, const char *pJSON, const char **ppResult)

Queries provided API on the specified Nuclideon udServer.

!NOTE The application should call udServerAPI_ReleaseResult with ppResult to destroy the data once it’s no longer needed.

ParameterDescription
pContextThe context to execute the query with.
pAPIAddressThe API address to query, this is the part of the address after /api/. The rest of the address is constructed from the context provided.
pJSONThe JSON text to POST to the API address.
ppResultA pointer to a location in which the result data is to be stored.

Returns: A udError value based on the result of the API query.

enum udError udServerAPI_QueryWithProgress(struct udContext *pContext, const char *pAPIAddress, const char *pJSON, const char **ppResult, udProgressCallback *pProgressCallback, void *pProgressUserData)

Queries provided API on the specified Nuclideon udServer.

!NOTE The application should call udServerAPI_ReleaseResult with ppResult to destroy the data once it’s no longer needed.

ParameterDescription
pContextThe context to execute the query with.
pAPIAddressThe API address to query, this is the part of the address after /api/. The rest of the address is constructed from the context provided.
pJSONThe JSON text to POST to the API address.
ppResultA pointer to a location in which the result data is to be stored.
pProgressCallbackA function callback when there are progress updates
pProgressUserDataA pointer that will be passed to the pProgressCallback

Returns: A udError value based on the result of the API query.

enum udError udServerAPI_ReleaseResult(const char **ppResult)

Destroys the result that was allocated.

!NOTE The value of ppResult will be set to NULL.

ParameterDescription
ppResultA pointer to a location in which the result data is stored.