PasteRack.org
Paste # 63874
2017-02-13 07:20:19

Fork as a new paste.

Paste viewed 414 times.


Embed:

  1. #lang racket
  2.  
  3. > (define j (get "/get"))
  4. > (json-response-headers j)
  5.  
  6. '#hasheq(("Server" . ("nginx"))
  7.          ("Access-Control-Allow-Credentials"
  8.           .
  9.           ("true"))
  10.          ("Access-Control-Allow-Origin" . ("*"))
  11.          ("Connection" . ("close"))
  12.          ("Content-Length" . ("318"))
  13.          ("Content-Type" . ("application/json"))
  14.          ("Date"
  15.           .
  16.           ("Mon, 13 Feb 2017 12:17:37 GMT")))
  17.  
  18. > (hash-keys (json-response-headers j))
  19. '("Date"
  20.   "Content-Type"
  21.   "Content-Length"
  22.   "Connection"
  23.   "Access-Control-Allow-Origin"
  24.   "Access-Control-Allow-Credentials"
  25.   "Server")
  26.  
  27. > (hash-ref (json-response-headers j) "Server")
  28.  
  29. hash-ref: no value found for key
  30.   key: "Server"

=>