http.ClientRequest poor documentation #2461
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Activity
Fishrock123 commentedon Aug 20, 2015
It might not be sorted the best but I do believe everything is there under
http.ClientRequestandhttp.IncomingMessage. Please let us know if there is something specific missing!Fishrock123 commentedon Aug 20, 2015
You may also want to do a nodeschool workshopper,
npm install -g learnyounode-- they are pretty helpful!magicdawn commentedon Aug 21, 2015
Yeah, I know
ClientRequest.prototype.end/writeand normally we usehttp.requestorhttp.get, we won't want to access the property onClientRequest, but under some circumstance such as above example above want to accessreqasClientRequest's property, such asurl, path, domain , host...blablabut only
req.methodhttps://github.com/nodejs/node/blob/master/lib%2F_http_client.js#L69req.pathhttps://github.com/nodejs/node/blob/master/lib%2F_http_client.js#L70available, and they are not in the documentation
magicdawn commentedon Aug 21, 2015
every property which is not start with a leading lodash
_is public. Am I wrongsam-github commentedon Aug 21, 2015
@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 commentedon Aug 21, 2015
@sam-github yeah, that's I'm saying.
pathmethodcan be accessed, but not in the documentationand host/protocal should be exposed too.
Fishrock123 commentedon Aug 21, 2015
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. :)
http: expose host and protocol on ClientRequest
http: expose host and protocol on ClientRequest
http: expose host and protocol on ClientRequest
http: expose host and protocol on ClientRequest