1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- // Licensed to the .NET Foundation under one or more agreements.
- // The .NET Foundation licenses this file to you under the MIT license.
- /** Represents an HTTP response. */
- export class HttpResponse {
- constructor(statusCode, statusText, content) {
- this.statusCode = statusCode;
- this.statusText = statusText;
- this.content = content;
- }
- }
- /** Abstraction over an HTTP client.
- *
- * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.
- */
- export class HttpClient {
- get(url, options) {
- return this.send({
- ...options,
- method: "GET",
- url,
- });
- }
- post(url, options) {
- return this.send({
- ...options,
- method: "POST",
- url,
- });
- }
- delete(url, options) {
- return this.send({
- ...options,
- method: "DELETE",
- url,
- });
- }
- /** Gets all cookies that apply to the specified URL.
- *
- * @param url The URL that the cookies are valid for.
- * @returns {string} A string containing all the key-value cookie pairs for the specified URL.
- */
- // @ts-ignore
- getCookieString(url) {
- return "";
- }
- }
- //# sourceMappingURL=HttpClient.js.map
|