PHP WebShell

Текущая директория: /opt/BitGoJS/modules/sdk-core/dist/src/bitgo/utils

Просмотр файла: postWithCodec.d.ts

import * as t from 'io-ts';
import { BitGoBase } from '../bitgoBase';
import { BitGoRequest } from '../../api';
import { SuperAgent, SuperAgentRequest } from 'superagent';
/**
 * Try to encode the body with the codec and send the request.
 * If the codec fails to encode the body, send the request with the body as is and set the 'codec-error' header to true.
 * Set the 'io-ts-unknown-properties' header to the list of unknown properties that are present in the body but not the codec.
 * @param bitgo
 * @param url
 * @param codec
 * @param body
 * @param [useEncodedBody=true] - when false, send the original body. Useful when writing new codecs.
 */
export declare function postWithCodec<TAgent extends BitGoBase | SuperAgent<any>, A extends Record<string, unknown>, O extends Record<string, unknown>>(agent: TAgent, url: string, codec: t.Type<A, O>, body: A, { useEncodedBody, }?: {
    useEncodedBody?: boolean;
}): TAgent extends BitGoBase ? BitGoRequest : SuperAgentRequest;
//# sourceMappingURL=postWithCodec.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!