This repository was archived by the owner on Oct 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33[ ![ MIT licensed] ( http://img.shields.io/:license-MIT-blue.svg )] ( LICENSE )
44[ ![ npm version] ( https://img.shields.io/npm/v/http-types )] ( https://npmjs.org/http-types )
55
6- Typescript library to read and write records of HTTP exchanges in the [ HTTP types] ( https://meeshkan.github.io/http-types/ ) format.
6+ Typescript library to read and write records of HTTP exchanges in the [ http- types] ( https://meeshkan.github.io/http-types/ ) format.
77
88## Install
99``` sh
1010$ npm install http-types
1111```
1212
1313# Writing HTTP exchanges
14- Using ` HttpExchangeWriter ` a recording of HTTP traffic can be serialised for use with any program that can handle the HTTP Types format.
14+ Using ` HttpExchangeWriter ` a recording of HTTP traffic can be serialised for use with any program that can handle the http-types format.
1515``` typescript
1616const writer = new HttpExchangeWriter ();
1717
@@ -41,7 +41,7 @@ writer.write({ request, response });
4141
4242// [...] (write multiple exchanges)
4343
44- // writer.buffer contains the exchanges in the HTTP types JSON Lines format.
44+ // writer.buffer contains the exchanges in the http- types JSON Lines format.
4545console .log (writer .buffer );
4646```
4747
@@ -67,7 +67,7 @@ const request = HttpRequestBuilder.fromPathnameAndQuery({
6767```
6868
6969# Reading HTTP exchanges
70- With ` HttpExchangeReader ` HTTP Types recordings can be read for processing:
70+ With ` HttpExchangeReader ` http-types recordings can be read for processing:
7171``` typescript
7272HttpExchangeReader .fromJsonLines (writer .buffer , exchange => {
7373 expect (exchange .request .host ).toBe (" example.com" );
You can’t perform that action at this time.
0 commit comments