I try to connect to the API, with the `pwg.session.login` method, with the HTTP method `POST`with the following url:
```
https://piwigo.buron.coffee/ws.php?format=json&method=pwg.session.login&username=test&password=test
```
I got the following error with a 405 HTTP code :
```
{"stat":"fail","err":405,"message":"This method requires HTTP POST"}
```
What am I doing wrong ?
<!-- github-sync-id:245248881 -->
You passed the argument in GET. Keep only {format, method} in GET but move {username, password} in POST.
Hi @emixam150
You passed the argument in GET. Keep only {format, method} in GET but move {username, password} in POST.
<!-- github-comment-id:317688812 -->
Actually I already test to post this : https://piwigo.buron.coffee/ws.php?format=json&method=pwg.session.login
with the body :
{
"username":"test",
"password":"test"
}
and it returns the same error, which it is not the good one, no ?
Actually I already test to post this :
`https://piwigo.buron.coffee/ws.php?format=json&method=pwg.session.login`
with the body :
```
{
"username":"test",
"password":"test"
}
```
and it returns the same error, which it is not the good one, no ?
<!-- github-comment-id:317704984 -->
you can try set request content type to application/x-www-form-urlencoded
body like this:
username=test&password=test
you can try set request content type to `application/x-www-form-urlencoded`
body like this:
username=test&password=test
<!-- github-comment-id:406552636 -->
I have been discussing with a user having the same issue. He was indeed sending a POST request, but all his parameters were in GET (in the URL), not in POST. The POST array was empty, thus the error thrown by Piwigo.
Only {format, method} must be in GET, other parameter in POST.
I have been discussing with a user having the same issue. He was indeed sending a POST request, but all his parameters were in GET (in the URL), not in POST. The POST array was empty, thus the error thrown by Piwigo.
Only `{format, method}` must be in GET, other parameter in POST.
<!-- github-comment-id:470599738 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I try to connect to the API, with the
pwg.session.loginmethod, with the HTTP methodPOSTwith the following url:I got the following error with a 405 HTTP code :
What am I doing wrong ?
Hi @emixam150
You passed the argument in GET. Keep only {format, method} in GET but move {username, password} in POST.
Actually I already test to post this :
https://piwigo.buron.coffee/ws.php?format=json&method=pwg.session.loginwith the body :
and it returns the same error, which it is not the good one, no ?
you can try set request content type to
application/x-www-form-urlencodedbody like this:
username=test&password=test
I have been discussing with a user having the same issue. He was indeed sending a POST request, but all his parameters were in GET (in the URL), not in POST. The POST array was empty, thus the error thrown by Piwigo.
Only
{format, method}must be in GET, other parameter in POST.