Skip to content

Commit 5e1cb65

Browse files
set default method for search to GET (issue #23)
1 parent 2f958ee commit 5e1cb65

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/search.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ function FeatureCollection(url,query; method=:get, _enctype = :form_urlencoded)
1616
ch = Channel{STAC.Item}() do c
1717
while true
1818
url = next_request[:href]
19-
if next_request[:method] == "POST"
19+
20+
if get(next_request,:method,"GET") == "POST"
2021
@debug "post $url" query
21-
if _enctype == :form_urlencoded
22-
r = HTTP.post(url,[],body=next_request[:body])
23-
elseif _enctype == :json
24-
b = JSON3.write(next_request[:body])
25-
r = HTTP.post(url,[],b)
26-
else
27-
error("unknown encoding for POST $_enctype")
28-
end
22+
if _enctype == :form_urlencoded
23+
r = HTTP.post(url,[],body=next_request[:body])
24+
elseif _enctype == :json
25+
b = JSON3.write(next_request[:body])
26+
r = HTTP.post(url,[],b)
27+
else
28+
error("unknown encoding for POST $_enctype")
29+
end
2930
else
3031
@debug "get $url"
3132
r = HTTP.get(url)

0 commit comments

Comments
 (0)