Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom HTTP arguments for queries #27

Merged
merged 4 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.10'
- '1.11'
- 'nightly'
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CitrusAPI"
uuid = "fb58f9c3-ae58-4847-ba51-3b3c84151ac7"
authors = ["Philipp Gewessler"]
version = "0.1.2"
version = "0.2.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -19,7 +19,7 @@ HTTP = "1"
JSON3 = "1"
Tables = "1"
URIs = "1"
julia = "1.6"
julia = "1.10"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
5 changes: 3 additions & 2 deletions src/CitrusClient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
mutable struct CitrusClient
url::String
session_key::Union{Nothing,String}
http_args::Base.Pairs
end

function CitrusClient(url::String, session_key = nothing)
return CitrusClient(url, session_key)
function CitrusClient(url::String, session_key = nothing; kwargs...)
return CitrusClient(url, session_key, kwargs)
end
2 changes: 1 addition & 1 deletion src/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function call_limesurvey_api(client::CitrusClient, payload; authenticated = true
end

headers = construct_headers()
response = HTTP.post(client.url, headers, payload)
response = HTTP.post(client.url, headers, payload; client.http_args...)
parsed_body = JSON3.read(response.body)

if !isnothing(parsed_body.error)
Expand Down
Loading