#reqwest — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #reqwest, aggregated by home.social.
-
Hey, I need help figuring out a bug with either #reqwest (the #Rust crate) or the #Neocities #API…
If you know anything about multipart forms or Rust or #Ruby, I'd really appreciate any help I can get :neocat_melt_blep: -
Alright #rust #rustlang folks, I’m still a tad new and having a hard time figuring this out. I’m wanting to create a small Rust app that runs Cloudflares speed tests from CLI, but I’m having a hell of a time on how to go about things like DNS, SSL resolution time, etc. I’m making an educated guess that the TTFB is just the interval between before and after awaiting a response. Am I looking at this the right way with #hyper and/or #reqwest?
-
Запилил тг-бота на расте для отправки комикса XKCD по номеру.
https://git.dc09.ru/darkcat09/xkcdtg
Из библиотек использованы только tokio (ну сам рантайм), reqwest (http-клиент) и serde (парсинг json), то есть клиент к тг бот апи я реализовал самостоятельно.
У телеграма наиболее приятная апишка из всех. Именно бот апи, не мтпрото. Загадка, однако, зачем эти ненормальные сделали враппер `{"ok": true, "result": …}` — для кого статус-коды в хттп придуманы?!
`/xkcd 927` — получить картинкой комикс про конкурирующие стандарты и тайтл-текст к нему,
`/xkcd ru 927` — тот же, но в русском переводе от xkcd.ru
Опробовать можно, только не ддосьте, прошу, я не тестировал под нагрузкой: https://t.me/dc09xkcd_bot
Или захостите сами лучше.
Ну прикольное, короче. Библиотеки типа tele-rs намеренно не брал, ибо задача очень простая + а чо б не реализовать самому. 104 пакета в дереве депсов, btw (а што вы хотели от npm-like системы).
#telegram #rust #reqwest #api #xkcd @ru -
I tried to use the #rbw crate to connect to connect to my #VaultWarden instance. Seems i cannot even construct a client and login: Some #reqwest error with relative base url.
If i construct the reqwest client directly it works. Any ideas? I cannot upload the code right now, maybe later.
-
reqwest::blocking vs ureq:
* executable size goes from 3.8 MB to 3.5MB
* execution time is roughly the same (very basic stuff)
* ureq requires more std lib inclusion to manage downloading/uploading files (like BufReader, BufWriter)So overall: meh.
-
@cjk My two cents:
When possible you should write code without depending on any runtime. Especially if you make crates used by others. It is not great when you are forced to use a specific runtime by a dependency. (Yes, looking at you #reqwest)
Ideally switching runtime should only be to rewrite your main function. But if you need more complex features that might not be possible yet.
Currently it seems Tokio is the way to go, if you want the big guns.