Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringify payload objects #143

Merged
merged 4 commits into from Aug 3, 2016
Merged

Stringify payload objects #143

merged 4 commits into from Aug 3, 2016

Conversation

@geek
Copy link
Member

geek commented Aug 3, 2016

Closes #113

@geek geek added the feature label Aug 3, 2016
@geek geek added this to the 9.0.0 milestone Aug 3, 2016
@@ -76,8 +76,8 @@ internals.Client.prototype.request = function (method, url, options, callback, _
options = Hoek.applyToDefaultsWithShallow(this._defaults, options || {}, internals.shallowOptions);

Hoek.assert(options.payload === null || options.payload === undefined || typeof options.payload === 'string' ||

This comment has been minimized.

Copy link
@cjihrig

cjihrig Aug 3, 2016

Contributor

You can drop the null check now.

README.md Outdated
var uri = '/';
var readableStream = Wreck.toReadableStream('foo=bar');
const method = 'GET'; // GET, POST, PUT, DELETE
const uri = '/';

This comment has been minimized.

Copy link
@cjihrig

cjihrig Aug 3, 2016

Contributor

While you're here, it would be a good time to remove the equal sign alignment :-)

README.md Outdated
@@ -82,7 +90,7 @@ Initiate an HTTP request.
If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. Any
querystring in the `baseUrl` will be overwritten with the querystring in the `uri` When `baseUrl` is given, `uri` must also be a string.
- `socketPath` - `/path/to/unix/socket` for Server.
- `payload` - The request body as string, Buffer, or Readable Stream.
- `payload` - The request body as string, Buffer, Readable Stream, or an object that can be executed by JSON.stringify.

This comment has been minimized.

Copy link
@cjihrig

cjihrig Aug 3, 2016

Contributor

"as string" -> "as a string"

This comment has been minimized.

Copy link
@cjihrig

cjihrig Aug 3, 2016

Contributor

"executed by JSON.stringify()" -> "serialized using JSON.stringify()". I'd put JSON.stringify() in backticks.

geek added 3 commits Aug 3, 2016
@cjihrig

This comment has been minimized.

Copy link
Contributor

cjihrig commented Aug 3, 2016

LGTM pending CI

@geek geek self-assigned this Aug 3, 2016
@geek geek merged commit 7ffec11 into hapijs:master Aug 3, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@geek geek deleted the geek:json branch Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.