package Ġguide . modules . ham k rest Ċ Ċ import Ġcom . nat pr y ce . ham k rest . and Ċ import Ġcom . nat pr y ce . ham k rest . assertion . assertThat Ċ import Ġcom . nat pr y ce . ham k rest . equalTo Ċ Ċ import Ġorg . http 4 k . core . Body Ċ import Ġorg . http 4 k . core . ContentType Ċ import Ġorg . http 4 k . core . Method Ċ import Ġorg . http 4 k . core . Request Ċ import Ġorg . http 4 k . core . Response Ċ import Ġorg . http 4 k . core . Status . Companion . OK Ċ import Ġorg . http 4 k . ham k rest . has Body Ċ import Ġorg . http 4 k . ham k rest . has Header Ċ import Ġorg . http 4 k . ham k rest . has Query Ċ import Ġorg . http 4 k . ham k rest . has Status Ċ import Ġorg . http 4 k . lens . string Ċ Ċ fun Ġmain () Ġ{ ĊĊĠĠĠ Ġval Ġrequest Ġ= ĠRequest ( Method . POST , Ġ"/ ? a = b "). body (" http 4 k Ġis Ġcool "). header (" my Ġheader ", Ġ" a Ġvalue ") ĊĊĠĠĠ Ġ// Ġstatus ĊĠĠĠ ĠassertThat ( Response ( OK ), Ġhas Status ( OK )) ĊĊĠĠĠ Ġ// Ġquery ĊĠĠĠ ĠassertThat ( request , Ġhas Query (" a ", Ġ" b ")) ĊĊĠĠĠ Ġ// Ġheader ĊĠĠĠ ĠassertThat ( request , Ġhas Header (" my Ġheader ", Ġ" a Ġvalue ")) ĊĊĠĠĠ Ġ// Ġbody ĊĠĠĠ ĠassertThat ( request , Ġhas Body ( equalTo (" http 4 k Ġis Ġcool "))) ĊĠĠĠ ĠassertThat ( request , Ġhas Body (" http 4 k Ġis Ġcool ")) ĊĠĠĠ ĠassertThat ( request , Ġhas Body ( Body . string ( ContentType . TEXT _ HTML ). to Lens (), ĠequalTo (" http 4 k Ġis Ġcool "))) ĊĊĠĠĠ Ġ// Ġcomposite ĊĠĠĠ ĠassertThat ( request , Ġhas Body ( equalTo (" http 4 k Ġis Ġcool ")). and ( has Query (" a ", Ġ" b "))) Ċ } Ċ