-
123查看全部
-
回调函数的例子查看全部
-
初学者网站:nodejs.org、nmpjs.org、github.com、stackoverflow.com查看全部
-
node.js模块,简单例子演示查看全部
-
截图保存查看全部
-
服务器请求状态码: 1XX:指示信息,表示信息已接收,正在处理 2XX:已成功接收并处理。 3XX:重定向 4XX:客户端错误 5XX:服务器端错误 200:OK 400:客户端请求有语法错误, 401:没有经过授权 403:拒绝提供服务 404:对象不存在 500:服务器端发生了一个不可预期的错误 503:服务器端当前不能处理,可能过一会能正常查看全部
-
var http=require('http') var querystring = require('querystring') var postData =querystring.stringify({ 'content':'有大把时光哟', 'mid':8837 }) var options ={ hostname : 'www.imooc.com', port:80, path :'/course/docomment', method:'POST', headers:{ 'Accept':'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6', 'Content-Length':postData.length, ..... } } var req =http.request(options,function(res){ console.log('status:'+res.statusCode); console.log('headers:'+JSON.stringify(res.headers)); res.on('data',function(chunk){ console.log(Buffer.isBuffer(chunk)) console.log(typeof chunk); }) res.on('end',function(){ console.log('评论完毕') }); res.on('error',function(e){ console.log('Error:'+e.message) }) }) req.write(postData); req.end();查看全部
-
url.parse(urlString[, parseQueryString[, slashesDenoteHost]])#<br> Added in: v0.1.25<br> urlString <string> The URL string to parse.<br> parseQueryString <boolean> If true, the query property will always be set to an object returned by the querystring module's parse() method. If false, the query property on the returned URL object will be an unparsed, undecoded string. Defaults to false.<br> slashesDenoteHost <boolean> If true, the first token after the literal string // and preceeding the next / will be interpreted as the host. For instance, given //foo/bar, the result would be {host: 'foo', pathname: '/bar'} rather than {pathname: '//foo/bar'}. Defaults to false.<br> The url.parse() method takes a URL string, parses it, and returns a URL object.查看全部
-
url.resolve(from, to)# Added in: v0.1.25 from <string> The Base URL being resolved against. to <string> The HREF URL being resolved. The url.resolve() method resolves a target URL relative to a base URL in a manner similar to that of a Web browser resolving an anchor tag HREF. For example: url.resolve('/one/two/three', 'four') // '/one/two/four' url.resolve('http://example.com/', '/one') // 'http://example.com/one' url.resolve('http://example.com/one', '/two') // 'http://example.com/two'查看全部
-
很火很强查看全部
-
找工作查看全部
-
进阶问题查看全部
-
http头和正文信息查看全部
-
TCP/IP;连接建立后浏览器可以向服务器发送http请求查看全部
-
三次握手,tcp连接请求查看全部
举报
0/150
提交
取消