댓글 검색 목록

[Nodejs] request - 단순화 된 HTTP 요청 클라이언트.

페이지 정보

작성자 운영자 작성일 19-03-07 11:29 조회 386 댓글 0

https://github.com/request/request


http.createServer(function (req, resp) {
  if (req.url === '/doodle.png') {
    if (req.method === 'PUT') {
      req.pipe(request.put('http://mysite.com/doodle.png'))
    } else if (req.method === 'GET' || req.method === 'HEAD') {
      request.get('http://mysite.com/doodle.png').pipe(resp)
    }
  }
})


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.