Skip to content

Commit

Permalink
feat: adding examples for image/png and application/zip payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Jan 22, 2022
1 parent 78b9080 commit fe7895e
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module.exports = {
'application-form-encoded': require('./src/application-form-encoded.har'),
'application-json': require('./src/application-json.har'),
'application-zip': require('./src/application-zip.har'),
cookies: require('./src/cookies.har'),
full: require('./src/full.har'),
headers: require('./src/headers.har'),
https: require('./src/https.har'),
'image-png-no-filename': require('./src/image-png-no-filename.har'),
'image-png': require('./src/image-png.har'),
'jsonObj-multiline': require('./src/jsonObj-multiline.har'),
'jsonObj-null-value': require('./src/jsonObj-null-value.har'),
'multipart-data-dataurl': require('./src/multipart-data-dataurl.har'),
Expand Down
65 changes: 65 additions & 0 deletions src/application-zip.har.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions src/image-png-no-filename.har.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module.exports = {
log: {
entries: [
{
startedDateTime: new Date().toISOString(),
time: new Date().getMilliseconds(),
request: {
method: 'POST',
url: 'https://httpbin.org/post',
httpVersion: 'HTTP/1.1',
cookies: [],
headers: [
{
name: 'content-type',
value: 'image/png',
},
],
queryString: [],
postData: {
mimeType: 'image/png',
text: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR4AWJkIA2wCQHqJgcouZ0ADv+SmayR28PibPOP2jafzdp6Lh/v2bVt2+1zbdvtbtbMpGfmvmD8jStc9uB3v75gdNmqtJqsa6qCDEBPRVH7XpKk1P9yHLZv3mG6keV9BIsWGqNuvNaiy+YoARFIXFXwf6Frjz/X9oS4LNRkty4QH/0MSnnWDHORHV3pJsiozRk0zWW/9MEi0A9ffqOhf5RRDW6SGLT/ZXcT8C1hWvao8iF1c4ecKx5eejW1bii1y1asW14P5XsUNkogmvVQg2aPLOnrqss9qE81OYlAucRrN/LrqlBSWYufv34jq7gKseA7MCr0IOhffForGsTWDBJnqE2/B0H+hKRRG3DtxEGk6QBZQ9UFClMSnTJe/cCVI5uQJJpx+8AyOBUPPv+JIpJjgJqCZzKT0AGdAgT/1OLtSzsKI2/gspnxvGExZYFADcoSsqM10SADF4jC4TCCUDN8nih+eoIgPAdGeajBNxyMH20JwsPNMwSicUjBCAwmAZ6GkCmA7I+qCxTGRHSkVzZiCRmKAsRkuVmWiENrt6gL5Di7iw4oogFSINIkCTU09hNAP64CREPUBbzAx9ABrc2I3w2NeY5DMByHu8AGY3YyeoKIuSmBWCD6OuqLPJXe/Dpvkb3FuoDbdENKuBVJ4nxZJpKgWoUXCMcYUwBwDfR8FxZPN4wfWK2Zunq7tGLmZMOc7x7ZUn/RuDmrX0H/4FffQ2teylCecuWmDNsTnainfwFPuNZTR3MemwAAAABJRU5ErkJggg==',
},
bodySize: -1,
headersSize: -1,
},
response: {
status: 200,
statusText: 'OK',
httpVersion: 'HTTP/1.1',
headers: [
{ name: 'Accept', value: '*/*' },
{ name: 'Accept-Encoding', value: 'gzip,deflate' },
{ name: 'Content-Length', value: 854 },
{ name: 'Content-Type', value: 'application/json' },
{ name: 'Host', value: 'httpbin.org' },
{ name: 'User-Agent', value: 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)' },
],
content: {
size: 597,
mimeType: 'application/json',
text: JSON.stringify({
args: {},
data: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNUlEQVR4AWJkIA2wCQHqJgcouZ0ADv+SmayR28PibPOP2jafzdp6Lh/v2bVt2+1zbdvtbtbMpGfmvmD8jStc9uB3v75gdNmqtJqsa6qCDEBPRVH7XpKk1P9yHLZv3mG6keV9BIsWGqNuvNaiy+YoARFIXFXwf6Frjz/X9oS4LNRkty4QH/0MSnnWDHORHV3pJsiozRk0zWW/9MEi0A9ffqOhf5RRDW6SGLT/ZXcT8C1hWvao8iF1c4ecKx5eejW1bii1y1asW14P5XsUNkogmvVQg2aPLOnrqss9qE81OYlAucRrN/LrqlBSWYufv34jq7gKseA7MCr0IOhffForGsTWDBJnqE2/B0H+hKRRG3DtxEGk6QBZQ9UFClMSnTJe/cCVI5uQJJpx+8AyOBUPPv+JIpJjgJqCZzKT0AGdAgT/1OLtSzsKI2/gspnxvGExZYFADcoSsqM10SADF4jC4TCCUDN8nih+eoIgPAdGeajBNxyMH20JwsPNMwSicUjBCAwmAZ6GkCmA7I+qCxTGRHSkVzZiCRmKAsRkuVmWiENrt6gL5Di7iw4oogFSINIkCTU09hNAP64CREPUBbzAx9ABrc2I3w2NeY5DMByHu8AGY3YyeoKIuSmBWCD6OuqLPJXe/Dpvkb3FuoDbdENKuBVJ4nxZJpKgWoUXCMcYUwBwDfR8FxZPN4wfWK2Zunq7tGLmZMOc7x7ZUn/RuDmrX0H/4FffQ2teylCecuWmDNsTnainfwFPuNZTR3MemwAAAABJRU5ErkJggg==',
files: {},
form: {},
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip,deflate',
'Content-Length': '854',
'Content-Type': 'image/png',
Host: 'httpbin.org',
'User-Agent': 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)',
},
json: null,
origin: '127.0.0.1',
url: 'https://httpbin.org/post',
}),
},
headersSize: -1,
bodySize: -1,
},
},
],
},
};
65 changes: 65 additions & 0 deletions src/image-png.har.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module.exports = {
log: {
entries: [
{
startedDateTime: new Date().toISOString(),
time: new Date().getMilliseconds(),
request: {
method: 'POST',
url: 'https://httpbin.org/post',
httpVersion: 'HTTP/1.1',
cookies: [],
headers: [
{
name: 'content-type',
value: 'image/png',
},
],
queryString: [],
postData: {
mimeType: 'image/png',
text: 'data:image/png;name=owlbert.png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAYAAABbayygAAABV0lEQVR4AWNwL/Bh0FGQ9FWUENUGsZExPz8/h5gArzmIDRZw1VfpSfeyagIJgiRBYkCg7mOl72akIt0KVwhSVB5o9SPESutJWajzquJgx/lRDganc7zNX3obq9SiKKxN8P/fmB33vybc7j+MHe1k8t9RSy4NrrA4K2Xp1k0b/peUlPzPjfL5v3bpgv9NTc3/48JD/sOsBju4JDnq6MS+3v9uLlb/pzeY/l82r+9/cIA/GNtrK2wFqQH7uDzY/gXQOrBpbemi/xO9DH4B2WCrQe4GqWHQVRDfBnLXpDTX/z3xTii4xM/if4iF5n+QGgZjZamvIIH5RT5wPKvQC0wDDQAr1FMQ/8YgK8zfAzIeqgCOp+V5gBW6Giq9A6kB+9pUXTiqINjwJ9B6uKKmBHuwW7XkhFeAYg2sMMWXQTvJh/2Uu6nciTgXvVsg7Gsp+xAkZqHPIA1SAwCKnrxJusHahgAAAABJRU5ErkJggg==',
},
bodySize: -1,
headersSize: -1,
},
response: {
status: 200,
statusText: 'OK',
httpVersion: 'HTTP/1.1',
headers: [
{ name: 'Accept', value: '*/*' },
{ name: 'Accept-Encoding', value: 'gzip,deflate' },
{ name: 'Content-Length', value: 575 },
{ name: 'Content-Type', value: 'application/json' },
{ name: 'Host', value: 'httpbin.org' },
{ name: 'User-Agent', value: 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)' },
],
content: {
size: 597,
mimeType: 'application/json',
text: JSON.stringify({
args: {},
data: 'data:image/png;name=owlbert.png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAYAAABbayygAAABV0lEQVR4AWNwL/Bh0FGQ9FWUENUGsZExPz8/h5gArzmIDRZw1VfpSfeyagIJgiRBYkCg7mOl72akIt0KVwhSVB5o9SPESutJWajzquJgx/lRDganc7zNX3obq9SiKKxN8P/fmB33vybc7j+MHe1k8t9RSy4NrrA4K2Xp1k0b/peUlPzPjfL5v3bpgv9NTc3/48JD/sOsBju4JDnq6MS+3v9uLlb/pzeY/l82r+9/cIA/GNtrK2wFqQH7uDzY/gXQOrBpbemi/xO9DH4B2WCrQe4GqWHQVRDfBnLXpDTX/z3xTii4xM/if4iF5n+QGgZjZamvIIH5RT5wPKvQC0wDDQAr1FMQ/8YgK8zfAzIeqgCOp+V5gBW6Giq9A6kB+9pUXTiqINjwJ9B6uKKmBHuwW7XkhFeAYg2sMMWXQTvJh/2Uu6nciTgXvVsg7Gsp+xAkZqHPIA1SAwCKnrxJusHahgAAAABJRU5ErkJggg==',
files: {},
form: {},
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip,deflate',
'Content-Length': '575',
'Content-Type': 'image/png',
Host: 'httpbin.org',
'User-Agent': 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)',
},
json: null,
origin: '127.0.0.1',
url: 'https://httpbin.org/post',
}),
},
headersSize: -1,
bodySize: -1,
},
},
],
},
};

0 comments on commit fe7895e

Please sign in to comment.