mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:07:44 +00:00
LibCore: Use URL in CHttpRequest
Now there's just CHttpRequest::set_url(URL), no need to specify the host, port and path manually anymore. Updated ChanViewer and Downloader for the API change.
This commit is contained in:
parent
fb636389d6
commit
ee83b1bcf4
6 changed files with 11 additions and 19 deletions
|
@ -19,8 +19,7 @@ BoardListModel::~BoardListModel()
|
|||
void BoardListModel::update()
|
||||
{
|
||||
CHttpRequest request;
|
||||
request.set_hostname("a.4cdn.org");
|
||||
request.set_path("/boards.json");
|
||||
request.set_url("http://a.4cdn.org/boards.json");
|
||||
|
||||
auto* job = request.schedule();
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@ void ThreadCatalogModel::set_board(const String& board)
|
|||
void ThreadCatalogModel::update()
|
||||
{
|
||||
CHttpRequest request;
|
||||
request.set_hostname("a.4cdn.org");
|
||||
request.set_path(String::format("/%s/catalog.json", m_board.characters()));
|
||||
request.set_url(String::format("http://a.4cdn.org/%s/catalog.json", m_board.characters()));
|
||||
|
||||
auto* job = request.schedule();
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ int main(int argc, char** argv)
|
|||
GApplication app(argc, argv);
|
||||
|
||||
CHttpRequest request;
|
||||
request.set_hostname("www.google.com");
|
||||
request.set_path("/");
|
||||
request.set_url("http://www.google.com/");
|
||||
|
||||
auto job = request.schedule();
|
||||
job->on_finish = [&job](bool success) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue