Commit Graph

140 Commits

Author SHA1 Message Date
tastytea c67c9db40c
Fix wrong endpoint translations. 2020-01-11 16:13:14 +01:00
tastytea f556df296f
Add HTTP methods PATCH and PUT. 2020-01-11 16:07:40 +01:00
tastytea 5051664136
Fixed some pleroma endpoints. 2020-01-11 15:56:16 +01:00
tastytea 8d04f7e9ea
Add support for sending files in HTTP forms. 2020-01-11 14:36:49 +01:00
tastytea f0a35bfd5b
Add add_mime_part().
Makes code more readable and decreases duplication.
2020-01-11 13:17:35 +01:00
tastytea 7ac1bc1377
Hide CURLWrapper::cancel_stream(). 2020-01-10 18:57:42 +01:00
tastytea 796e159cdc
Actually set the proxy to the string in CURLWrappper::set_proxy(). 2020-01-10 18:50:53 +01:00
tastytea f601e770ac
Define CURLAUTH_BEARER as CURLAUTH_ANY with libcurl < 7.61.0
continuous-integration/drone/push Build is passing Details
2020-01-10 17:43:50 +01:00
tastytea 20167fdce3
Replace if constexpr with preprocessor if.
continuous-integration/drone/push Build is passing Details
2020-01-10 17:15:23 +01:00
tastytea c47a62969f
Only use CURLAUTH_BEARER if libcurl supports it.
continuous-integration/drone/push Build is failing Details
2020-01-10 17:10:36 +01:00
tastytea da033c3ffc
Silence clang-tidy warnings I can't do anything about.
continuous-integration/drone/push Build is failing Details
2020-01-10 14:35:44 +01:00
tastytea cb7019a0fd
Allow HTTP POST without parameters. 2020-01-10 14:33:33 +01:00
tastytea c3bb9a20c4
Send the access token. 2020-01-10 14:26:50 +01:00
tastytea 1910e780b0
Add vector fields to HTTP forms. 2020-01-10 14:24:35 +01:00
tastytea 89c50951b3
Fix User-Agent. 2020-01-10 13:41:38 +01:00
tastytea a6139b4390
Implement HTTP POST in Connection. 2020-01-10 13:08:55 +01:00
tastytea f222215116
Implement HTTP POST in CURLWrapper. 2020-01-10 13:08:34 +01:00
tastytea 1263b03999
Add a message only constructor to CURLException. 2020-01-10 12:22:00 +01:00
tastytea 7ba967a36c
Fix answer_type::get_header().
continuous-integration/drone/push Build is passing Details
The previous implementation returned a reference to an out-of-scope string.
2020-01-09 15:54:52 +01:00
tastytea 447fc05dbe
Add get_header() to answer_type.
continuous-integration/drone/push Build is passing Details
2020-01-09 14:00:40 +01:00
tastytea bb6b00114e
Clear buffers before making a request.
continuous-integration/drone/push Build is passing Details
2020-01-09 13:14:24 +01:00
tastytea bf82525c5e
Add baseurl to uri if endpoint is string_view. 2020-01-09 13:12:50 +01:00
tastytea ec41063488
Add get_new_events().
continuous-integration/drone/push Build is passing Details
A more comfortable way to consume stream events.
2020-01-09 12:24:29 +01:00
tastytea 839e29b37b
Expand section about thread safety in documentation. 2020-01-09 11:23:30 +01:00
tastytea e4a5b8e9ce
Move set_proxy() to Instance. 2020-01-09 11:23:15 +01:00
tastytea 7edcb7c507
Add streaming example. 2020-01-08 21:49:48 +01:00
tastytea 0e3b812b54
Only check for libcurl return code if it could return an error. 2020-01-08 21:36:59 +01:00
tastytea d2de78ff9e
Add streaming support. 2020-01-08 21:27:27 +01:00
tastytea a724006854
Make curl writer non-satatic and add static wrapper.
We need to use the mutex, a class member, from within the writer function.
2020-01-08 19:55:34 +01:00
tastytea c93810e241
Move URI building for GET requets to add_parameters_to_uri(). 2020-01-08 17:51:53 +01:00
tastytea 6b5936a4b6
Replace append with +=.
continuous-integration/drone/push Build is passing Details
2020-01-08 17:39:47 +01:00
tastytea 4b118e75f1
Fix / ignore some clang-tidy warnings. 2020-01-08 17:38:27 +01:00
tastytea deed340f3d
Add set_proxy(). 2020-01-08 17:20:36 +01:00
tastytea 1f78b00205
Replace string with string_view where possible. 2020-01-08 16:46:27 +01:00
tastytea 2ab0018df9
Replace arguments in URI.
continuous-integration/drone/push Build is passing Details
id, nickname, nickname_or_id, hashtag, permission_group.
2020-01-08 14:13:55 +01:00
tastytea c07fb1db71
Add support for parameters (GET). 2020-01-08 13:06:12 +01:00
tastytea 15c1e15466
Follow up to 10 HTTP redirects automatically.
This includes permanent redirects.
2020-01-08 11:53:01 +01:00
tastytea 50ae16002b
Make curlwrapper_instances explicitly atomic.
continuous-integration/drone/push Build is passing Details
2020-01-08 11:27:19 +01:00
tastytea 935c84e001
Search for all directories in shorten_filename().
continuous-integration/drone/push Build is passing Details
2020-01-06 16:43:14 +01:00
tastytea 27054d480e
Fix initialization notation of version. 2020-01-06 16:42:42 +01:00
tastytea f01ec3eee0
Set User-Agent. 2020-01-06 16:38:09 +01:00
tastytea 5d90fa97f1
Renamed return_types.hpp to answer.hpp.
continuous-integration/drone/push Build is passing Details
2020-01-06 14:43:10 +01:00
tastytea a1a6997619
Exclude shorten_filename from doxygen.
continuous-integration/drone/push Build is passing Details
2020-01-06 10:03:18 +01:00
tastytea 0638f8fe9a
Query max_toot_chars the first time get_max_chars() is called. 2020-01-06 09:31:05 +01:00
tastytea 6663cca653
Change signature of Instance. 2020-01-06 09:11:32 +01:00
tastytea a6bd081280
Refactored constructor of Instance.
continuous-integration/drone/push Build is passing Details
2020-01-05 20:47:34 +01:00
tastytea cb7dee1ab7
Add errorlog.
continuous-integration/drone/push Build is passing Details
2020-01-05 20:39:05 +01:00
tastytea 3c6c56d973
Make curlwrapper_instances static. 2020-01-05 20:27:28 +01:00
tastytea b93fe57cae
Show filename in debuglog instead of function. 2020-01-05 20:19:59 +01:00
tastytea b8802d3674
Make assignment to _max_chars clearer. 2020-01-05 20:10:54 +01:00
tastytea be2f00faae
Do global curl init / cleanup only once.
continuous-integration/drone/push Build is passing Details
2020-01-05 19:09:22 +01:00
tastytea 159cd05f5a
Make _endpoint_map static. 2020-01-05 19:00:24 +01:00
tastytea fba5a576f0
Add support for HTTP method PUT. 2020-01-05 16:16:22 +01:00
tastytea 1bfe3136aa
Add placeholder for :hashtag. 2020-01-05 16:15:58 +01:00
tastytea 765fc86179
Add all API endpoints of Pleroma 1.1.7.
continuous-integration/drone/push Build is passing Details
2020-01-05 16:01:38 +01:00
tastytea 571206c9f4
Only construct 1 API per Connection.
continuous-integration/drone/push Build is passing Details
2020-01-05 15:20:59 +01:00
tastytea 1226f7e57b
Add all API endpoints of Mastodon 3.0. 2020-01-05 15:03:30 +01:00
tastytea a77f773c46
Add support for HTTP methods PATCH and DELETE. 2020-01-05 13:59:43 +01:00
tastytea 4cbda2c091
Include function name instead of file name in debuglog. 2020-01-05 12:41:25 +01:00
tastytea 31950d280d
make_request(): Return complete answer_type,
and don't throw if curl_easy_perform() fails.
2020-01-05 12:32:57 +01:00
tastytea 078130bac6
Change argument “meth” to “method” in make_request(). 2020-01-05 12:21:58 +01:00
tastytea 4016260954
Check for http_status in answer_type::operator bool(). 2020-01-05 12:03:42 +01:00
tastytea 9c279822b2
Add headers to answer_type. 2020-01-05 12:03:23 +01:00
tastytea 96e9d9a9fd
answer_type: Replace error_code with curl_error_code. 2020-01-05 11:52:07 +01:00
tastytea 4aa24900ef
Microfix CURLException message.
continuous-integration/drone/push Build is passing Details
2020-01-05 11:17:14 +01:00
tastytea 61a26dbb67
Query instance for max_toot_chars. 2020-01-05 11:17:10 +01:00
tastytea 80cec5b45d
Add debuglog. 2020-01-05 11:06:29 +01:00
tastytea 9b49bc1d17
Optimize request-flow. 😃 2020-01-05 10:35:38 +01:00
tastytea db315a3a70
Instance: Add getters for hostname, baseuri and access_token. 2020-01-05 10:33:54 +01:00
tastytea f872707036
Renamed “Request” to “Connection”.
It will be used not for only one request, but for all requests to an instance.
2020-01-05 09:38:13 +01:00
tastytea cac3e0b505
Simple GET request works.
continuous-integration/drone/push Build is passing Details
2020-01-04 19:05:18 +01:00
tastytea 0b525bb748
Add http_method and make_request. 2020-01-04 19:04:50 +01:00
tastytea 051cf16ceb
Remove premature global curl cleanup, improve documentation. 2020-01-04 18:25:26 +01:00
tastytea a7a861351f
Move low-level network stuff to CURLWrapper. 2020-01-04 18:11:24 +01:00
tastytea c7f61434b6
Silence some linter warnings I can't do anything about. 2020-01-04 16:24:11 +01:00
tastytea 81e579f162
Only initialize libcurl once. 2020-01-04 16:23:52 +01:00
tastytea 10caa4c7e2
Delete empty file mastodonpp.cpp. 2020-01-04 16:01:42 +01:00
tastytea c9009e1de0
Add FindCURL-workaround CMake < 3.12.
continuous-integration/drone/push Build is passing Details
2020-01-04 12:10:44 +01:00
tastytea c77a68930c
Change linking of curl to PUBLIC.
continuous-integration/drone/push Build is failing Details
2020-01-04 11:46:34 +01:00
tastytea 4acab9da5c
Add Request::get() (without real function for now).
continuous-integration/drone/push Build is failing Details
2020-01-04 11:38:58 +01:00
tastytea e6690c85b4
Add curl initialization. 2020-01-04 11:38:27 +01:00
tastytea 6d9096193b
Add CURLException. 2020-01-04 11:37:08 +01:00
tastytea 0311b868aa
Put API endpoints in class API. 2020-01-04 09:29:52 +01:00
tastytea 5f96861ea8
Rename answer to answer_type. 2020-01-04 09:12:00 +01:00
tastytea e88238a37c
Fix target_sources. 2020-01-03 16:20:27 +01:00
tastytea 59778f0d75
Add version header. 2020-01-03 15:59:43 +01:00
tastytea 2ec7809a7d
Use target_sources. 2020-01-03 15:58:41 +01:00
tastytea 4c557aae6e
Use Instance and Request classes. 2020-01-03 12:42:10 +01:00
tastytea 49e910ecd8
Add return type for requests. 2020-01-03 10:30:56 +01:00
tastytea 5dc047811e
Add skeleton. 2020-01-03 08:32:03 +01:00