Skip to content

Commit

Permalink
Merge pull request #752 from zapier/PLATSUP-1022-docs-allowgetbody-re…
Browse files Browse the repository at this point in the history
…q-opt

[PLATSUP-1022] Document `allowGetBody` option in `z.request()` options
  • Loading branch information
eliangcs authored Mar 1, 2024
2 parents fd85851 + 9cc56b0 commit c7dcf08
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4060,6 +4060,7 @@ <h3 id="http-request-options">HTTP Request Options</h3>
<li><code>headers</code>: request headers object, format <code>{&apos;header-key&apos;: &apos;header-value&apos;}</code>.</li>
<li><code>params</code>: URL query params object, format <code>{&apos;query-key&apos;: &apos;query-value&apos;}</code>.</li>
<li><code>body</code>: request body, can be a string, buffer, readable stream or plain object. When it is an object/array and the <code>Content-Type</code> header is <code>application/x-www-form-urlencoded</code> the body will be transformed to query string parameters, otherwise we&apos;ll set the header to <code>application/json; charset=utf-8</code> and JSON encode the body. Default is <code>null</code>.</li>
<li><code>allowGetBody</code>: include <code>body</code> in <code>GET</code> requests. Set to <code>true</code> to enable. Default is <code>false</code>. Set only if required by the receiving API. See <a href="https://www.rfc-editor.org/rfc/rfc7231#section-4.3.1">section 4.3.1 in RFC 7231</a>.</li>
<li><code>json</code>: shortcut object/array/etc. you want to JSON encode into body. Default is <code>null</code>.</li>
<li><code>form</code>: shortcut object. you want to form encode into body. Default is <code>null</code>.</li>
<li><code>raw</code>: set this to stream the response instead of consuming it immediately. Default is <code>false</code>.</li>
Expand Down
1 change: 1 addition & 0 deletions packages/cli/README-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ Ensure you're handling errors correctly for your platform version. The latest re
* `headers`: request headers object, format `{'header-key': 'header-value'}`.
* `params`: URL query params object, format `{'query-key': 'query-value'}`.
* `body`: request body, can be a string, buffer, readable stream or plain object. When it is an object/array and the `Content-Type` header is `application/x-www-form-urlencoded` the body will be transformed to query string parameters, otherwise we'll set the header to `application/json; charset=utf-8` and JSON encode the body. Default is `null`.
* `allowGetBody`: include `body` in `GET` requests. Set to `true` to enable. Default is `false`. Set only if required by the receiving API. See [section 4.3.1 in RFC 7231](https://www.rfc-editor.org/rfc/rfc7231#section-4.3.1).
* `json`: shortcut object/array/etc. you want to JSON encode into body. Default is `null`.
* `form`: shortcut object. you want to form encode into body. Default is `null`.
* `raw`: set this to stream the response instead of consuming it immediately. Default is `false`.
Expand Down
1 change: 1 addition & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,7 @@ Ensure you're handling errors correctly for your platform version. The latest re
* `headers`: request headers object, format `{'header-key': 'header-value'}`.
* `params`: URL query params object, format `{'query-key': 'query-value'}`.
* `body`: request body, can be a string, buffer, readable stream or plain object. When it is an object/array and the `Content-Type` header is `application/x-www-form-urlencoded` the body will be transformed to query string parameters, otherwise we'll set the header to `application/json; charset=utf-8` and JSON encode the body. Default is `null`.
* `allowGetBody`: include `body` in `GET` requests. Set to `true` to enable. Default is `false`. Set only if required by the receiving API. See [section 4.3.1 in RFC 7231](https://www.rfc-editor.org/rfc/rfc7231#section-4.3.1).
* `json`: shortcut object/array/etc. you want to JSON encode into body. Default is `null`.
* `form`: shortcut object. you want to form encode into body. Default is `null`.
* `raw`: set this to stream the response instead of consuming it immediately. Default is `false`.
Expand Down
1 change: 1 addition & 0 deletions packages/cli/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4060,6 +4060,7 @@ <h3 id="http-request-options">HTTP Request Options</h3>
<li><code>headers</code>: request headers object, format <code>{&apos;header-key&apos;: &apos;header-value&apos;}</code>.</li>
<li><code>params</code>: URL query params object, format <code>{&apos;query-key&apos;: &apos;query-value&apos;}</code>.</li>
<li><code>body</code>: request body, can be a string, buffer, readable stream or plain object. When it is an object/array and the <code>Content-Type</code> header is <code>application/x-www-form-urlencoded</code> the body will be transformed to query string parameters, otherwise we&apos;ll set the header to <code>application/json; charset=utf-8</code> and JSON encode the body. Default is <code>null</code>.</li>
<li><code>allowGetBody</code>: include <code>body</code> in <code>GET</code> requests. Set to <code>true</code> to enable. Default is <code>false</code>. Set only if required by the receiving API. See <a href="https://www.rfc-editor.org/rfc/rfc7231#section-4.3.1">section 4.3.1 in RFC 7231</a>.</li>
<li><code>json</code>: shortcut object/array/etc. you want to JSON encode into body. Default is <code>null</code>.</li>
<li><code>form</code>: shortcut object. you want to form encode into body. Default is <code>null</code>.</li>
<li><code>raw</code>: set this to stream the response instead of consuming it immediately. Default is <code>false</code>.</li>
Expand Down

0 comments on commit c7dcf08

Please sign in to comment.