http_response.d.ts 920 B

123456789101112131415161718192021222324252627282930313233
  1. import * as stream from 'stream';
  2. interface XMLHttpRequest {}
  3. /**
  4. * The low level HTTP response object, encapsulating all HTTP header and body data returned from the request.
  5. */
  6. export class HttpResponse {
  7. /**
  8. * Disables buffering on the HTTP response and returns the stream for reading.
  9. */
  10. createUnbufferedStream(): stream.Readable|XMLHttpRequest
  11. /**
  12. * The response body payload.
  13. */
  14. body: string|Buffer|Uint8Array;
  15. /**
  16. * A map of response header keys and their respective values.
  17. */
  18. headers: {
  19. [key: string]: string;
  20. }
  21. /**
  22. * The HTTP status code of the response (e.g., 200, 404).
  23. */
  24. statusCode: number;
  25. /**
  26. * The HTTP status message of the response (e.g., 'Bad Request', 'Not Found')
  27. */
  28. statusMessage: string;
  29. /**
  30. * Whether this response is being streamed at a low-level.
  31. */
  32. streaming: boolean;
  33. }