Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. local http = require "resty.http"
  2. local httpc = http.new()
  3. local res, err = httpc:request_uri("https://www.google.com/")
  4. if not res then
  5. ngx.log(ngx.ERR,"failed to request: ", err)
  6. return
  7. end
  8.  
  9. ngx.status = res.status
  10.  
  11. ngx.say(res.status)
  12. ngx.say(res.body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement