From 21b60fa6990a81783500afef94e2ab7fc42c3d63 Mon Sep 17 00:00:00 2001 From: "Panayotis Procopiou (Paul)" Date: Tue, 27 Dec 2022 18:49:56 -0500 Subject: [PATCH] Fix "Setting Headers" example in "Testing Actions" Sending two separate arguments fails with an argument error. The syntax that works is to send them like a hash: `headers("Content-Type": "application/json")` --- src/actions/guides/testing/testing_actions.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/actions/guides/testing/testing_actions.cr b/src/actions/guides/testing/testing_actions.cr index 64299eaa..1fdce9ad 100644 --- a/src/actions/guides/testing/testing_actions.cr +++ b/src/actions/guides/testing/testing_actions.cr @@ -60,9 +60,9 @@ class Guides::Testing::TestingActions < GuideAction client = ApiClient.new client - .headers("Accept", "application/vnd.api.v1+json") - .headers("Set-Cookie", "remember_me=1") - .headers("Authorization", "Bearer abc123") + .headers("Accept": "application/vnd.api.v1+json") + .headers("Set-Cookie": "remember_me=1") + .headers("Authorization": "Bearer abc123") # Then make your request: client.exec(Api::Users::Index) @@ -80,7 +80,7 @@ class Guides::Testing::TestingActions < GuideAction def page(page : Int32, per_page = 10) # Set pagination headers - headers("Range", "order,id \#{page * per_page}; order=desc,max=\#{per_page}" + headers("Range": "order,id \#{page * per_page}; order=desc,max=\#{per_page}" end end ```