Skip to content

Commit 02391d8

Browse files
authored
Merge pull request #65 from keegoid-nr/kmullaney/encoding
docs: update encoding and headers
2 parents cc828dd + cadc8ca commit 02391d8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,22 @@ If your payload exceeds this size, you will need to split it into pieces:
7171

7272
<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L292-L306>
7373

74-
The payload should be gzipped before sending:
74+
The payload should be utf-8 encoded and then gzipped before sending:
7575

7676
<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L298>
7777

78+
The following GNU coreutils Bash command will reproduce the desired payload encoding and compression:
79+
80+
```sh
81+
xclip -sel clip -o | iconv -cf utf-8 | gzip > payload.gz
82+
```
83+
7884
Required headers include:
7985

8086
* <https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L360-L361>
81-
* `Content-Length`
82-
* `Host`
87+
* `Accept-Encoding: gzip`
88+
* `Content-Length: <calculated when request is sent>`
89+
* `Host: <calculated when request is sent>`
8390

8491
The payload should include the following (properly escaped) elements[^1]:
8592

0 commit comments

Comments
 (0)