-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update readme example #63
Comments
domain <- "https://opencpu.lifewatch.be/library/etnservice/R"
function_identity <- "list_animal_ids"
username <- "[email protected]"
httr2::request(domain) |>
httr2::req_url_path_append(paste(sep = "/", function_identity, "json")) |>
httr2::req_body_json(data = list(credentials = list(username = username,
password = askpass::askpass()))) |>
httr2::req_perform() |>
httr2::resp_body_json(check_type = FALSE)
Also doesn't work for Sanne with a HTTP 400 return |
@sannegovaert Could you try this in powershell just to validate your credentials? $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = @"
{
`"username`": `"your_username`",
`"password`": `"your_password`"
}
"@
$response = Invoke-RestMethod 'https://opencpu-test.lifewatch.be/library/etnservice/R/validate_login/json' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json |
Or Curl curl --location 'https://opencpu-test.lifewatch.be/library/etnservice/R/validate_login/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "your_username",
"password": "your_pwd"
}' |
The response is |
So your credentials work, good to have that out of the way!
…On Fri, 28 Mar 2025, 12:09 Sanne Govaert, ***@***.***> wrote:
@sannegovaert <https://github.com/sannegovaert> Could you try this in
powershell just to validate your credentials?
$headers = New-Object
"System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = @"
{
"username": "your_username",
"password": "your_password"
}
"@
$response = Invoke-RestMethod '
https://opencpu-test.lifewatch.be/library/etnservice/R/validate_login/json'
-Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
The response is true.
—
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALOW2O7LTUWISPUF2LEGCWT2WUNWHAVCNFSM6AAAAABZ5NH6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRRGA2DEMJQGU>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
[image: sannegovaert]*sannegovaert* left a comment (inbo/etnservice#63)
<#63 (comment)>
@sannegovaert <https://github.com/sannegovaert> Could you try this in
powershell just to validate your credentials?
$headers = New-Object
"System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = @"
{
"username": "your_username",
"password": "your_password"
}
"@
$response = Invoke-RestMethod '
https://opencpu-test.lifewatch.be/library/etnservice/R/validate_login/json'
-Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
The response is true.
—
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALOW2O7LTUWISPUF2LEGCWT2WUNWHAVCNFSM6AAAAABZ5NH6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRRGA2DEMJQGU>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
I had a typo in my username... So there is nog bug! |
I am wrong, the inital code does not work but the new solution works :-) |
Readme to be updated! |
The code in the README gives an error.
The text was updated successfully, but these errors were encountered: