Passing Query Parameters

WebTau offers a number of ways of specifying query parameters: Groovy http.get("/path?a=1&b=text") { // assertions go here } Java http.get("/path?a=1&b=text", ((header, body) -> { // assertions go here })); Use Map as a second parameter to pass query parameters. Suitable for languages that support in-line creation of Map . Groovy http.get("/path", [a: 1, b: "text"]) { // assertions go here } Java http.get("/path", map("a", 1, "b", "text"), ((header, body) -> { // assertions go here })); Only http.get has a Map variant, for http.put , http.post , etc you need to pass http.query . Groovy http.post("/chat", http.query([a: 1, b: "text"]), http.header(["x-param": "value"]), [message: "hello"]) { // assertions go here } Java http.post("/chat", http.query("a", 1, "b", "text"), http.header("x-param", "value"), http.json("message", "hello"), (header, body) -> { // assertions go here });

Parameters Encoding

All query parameters are encoded automatically. Groovy http.get("/path", http.query([message: "hello world !"])) { // assertions go here } Java http.get("/path", http.query("message", "hello world !"), (header, body) -> { // assertions go here }); /path?message=hello+world+%21