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

http.ClientRequest poor documentation #2461

Closed
magicdawn opened this issue Aug 20, 2015 · 7 comments
Closed

http.ClientRequest poor documentation #2461

magicdawn opened this issue Aug 20, 2015 · 7 comments
Labels
doc Issues and PRs related to the documentations.

Comments

@magicdawn
Copy link

I'm using tj's superagent, and I want to inspect the actual url requesting

var request = require('superagent');

request
   .get('<some url>')
   .on('request',function(){
        var req = this.req; // req instanceof http.ClientRequest
    })
   .end(function(err,res){

    })

req instanceof http.ClientRequest, but I can hardly find any property reference in the documentation on http.ClientRequest class https://iojs.org/api/http.html#http_class_http_clientrequest

@ChALkeR ChALkeR added the doc Issues and PRs related to the documentations. label Aug 20, 2015
@Fishrock123
Copy link
Contributor

It might not be sorted the best but I do believe everything is there under http.ClientRequest and http.IncomingMessage. Please let us know if there is something specific missing!

@Fishrock123
Copy link
Contributor

You may also want to do a nodeschool workshopper, npm install -g learnyounode -- they are pretty helpful!

@magicdawn
Copy link
Author

Yeah, I know ClientRequest.prototype.end/write and normally we use http.request or http.get, we won't want to access the property on ClientRequest, but under some circumstance such as above example above want to access req as ClientRequest 's property, such as url , path, domain , host...blabla

but only

available, and they are not in the documentation

@magicdawn
Copy link
Author

every property which is not start with a leading lodash _ is public. Am I wrong

@sam-github
Copy link
Contributor

@magicdawn I'm having difficulty understanding what you are trying to say. Is there some specific property that you think is public and that is not documented? If so, which ones?

@magicdawn
Copy link
Author

@sam-github yeah, that's I'm saying.

path method can be accessed, but not in the documentation
and host/protocal should be exposed too.

@Fishrock123
Copy link
Contributor

Not everything that is "publicly exposed" (i.e. exposed without a _) is documented. Some of this is probably intentional. Other, it is possible no-one got around to writing the docs for.

We'd probably happy to take a PR to add docs for those I think. :)

ronag pushed a commit that referenced this issue Jun 22, 2020
Allow host and protocol to be inspected.

PR-URL: #33803
Fixes: #2461
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
codebytere pushed a commit that referenced this issue Jun 27, 2020
Allow host and protocol to be inspected.

PR-URL: #33803
Fixes: #2461
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
codebytere pushed a commit that referenced this issue Jun 30, 2020
Allow host and protocol to be inspected.

PR-URL: #33803
Fixes: #2461
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this issue Sep 22, 2020
Allow host and protocol to be inspected.

PR-URL: #33803
Fixes: #2461
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants