-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Adding entry through the api returns "500 Internal Server Error" #1780
Comments
Can't see why for now, but wallabag doesn't retrieves the URL, which is EDIT : Nothing is passed to |
OK, so it seems it doesn't work with HTTPie. For some reason the
|
I can confirm that it works with |
Can we close? |
For my purposes, the problem is solved. The original issue still exists though. I don't know if the problem lies with wallabag or httpie. If its a problem with wallabag, maybe the issue shouldn't be closed yet.
|
Maybe we can ask for help on HTTPie's side (cc @jkbrzt) ? |
The HTTPie command seems wrong because For data, one needs to use the And looking at the curl example it looks like the request should be form-encoded, so the HTTPie command in its simplest form should probably look like this: http --form "$WALLABAG_URL/api/entries.json" \
Authorization:"Bearer $access_token" \
url=http://www.text.com/article.html \
tags= \
starred=false \
archive=false I recommend using the |
Thank you for taking the time to answer. We should have seen this, sorry. |
@tcitworld no worries, happy to help |
Thank you for your help, this does successfully add the entry. http --verbose --form "$WALLABAG_URL/api/entries.json" \
Authorization:"Bearer $access_token" \
starred="false" \
url="http://www.test.com/article.html" \
archive="false" "starred" and "archive" are set to true by the server (even though the data is sent correctly). POST /api/entries.json HTTP/1.1
Host: v2.wallabag.org
Accept-Encoding: gzip, deflate
Authorization: Bearer <...>
Accept: */*
Connection: keep-alive
User-Agent: HTTPie/0.9.3
Content-Length: 72
Content-Type: application/x-www-form-urlencoded; charset=utf-8
url=http%3A%2F%2Fwww.test.com%2Farticle.html&starred=false&archive=false And the server's response: HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 09:48:13 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=<...>; expires=Wed, 15-Mar-17 09:48:12 GMT; path=/; domain=.wallabag.org; HttpOnly
0: application/json
Cache-Control: no-cache
Server: cloudflare-nginx
CF-RAY: 283f0c6419d50725-AMS
Content-Encoding: gzip
{
"id":412,
"title":"No title found",
"url":"https:\/\/www.test.com\/",
"is_archived":true,
"is_starred":true,
"content":"wallabag can't retrieve contents for this article. Please report this issue to us.",
"created_at":"2016-03-15T10:48:13+0100",
"updated_at":"2016-03-15T10:48:13+0100",
"mimetype":"text\/html",
"reading_time":0,
"domain_name":"www.test.com",
"user":{<...>},
"tags":[],
"_links":
{
"self":{"href":"\/api\/entries\/412"}
}
} Entirely removing "archive" and "starred" from the request uses the correct defaults (false). |
I can't test right now, but can you try removing the quotes surrounding |
Tried it, that makes no difference. |
Got it. Fix on it's way. You can put |
Awesome, thanks |
OK, so we're going with 0/1 instead of true/false for these parameters. |
Issue details
I'm trying to write a simple shell script to add an entry to my wallabag account. I've got the authorization working properly, and getting all entries works without problems.
Adding an entry however returns an "Internal Server Error".
If I'm reading the api documentation correctly I provide the server with all the information it needs.
Here's the script:
And here's the output:
Environment
I'm using the hosted beta (beta 2).
Steps to reproduce/test case
See the script above.
The text was updated successfully, but these errors were encountered: