http.head.js 426 B

1234567891011121314
  1. /*
  2. http.head Request the header information about the respond
  3. */
  4. requirelib("http")
  5. //Get the respond header of the localhost
  6. var respHeader = JSON.parse(http.head("http://localhost:8080/"));
  7. var respHeaderContentType = JSON.parse(http.head("http://localhost:8080/", "Content-Type"));
  8. //Relay the JSON to client
  9. sendJSONResp(JSON.stringify({
  10. "full-header": respHeader,
  11. "Content-Type": respHeaderContentType,
  12. }));