aft-web-services
Version:
Automated Functional Testing (AFT) module for testing web services over HTTP and HTTPS
19 lines (18 loc) • 718 B
TypeScript
import { Func, JsonObject } from "aft-core";
import { HttpResponse } from "./http-custom-types";
declare class HttpData {
private readonly _xmlParser;
constructor(xmlParser?: Func<string, JsonObject>);
/**
* attempts to parse the contents of this `HttpResponse.data` into the specified
* type
* #### NOTE:
* > attempts to read the `content-type` header and if it contains
* `html` or `xml` it will parse the data string as XML, otherwise as JSON
* @returns the contents of this `HttpResponse.data` string parsed into an object
* of the specified type.
*/
as<T extends JsonObject>(response: HttpResponse): T;
}
export declare const httpData: HttpData;
export {};