ikod / dlang-requests

dlang http client library inspired by python-requests
Boost Software License 1.0
154 stars 32 forks source link

external URI parser #12

Open ikod opened 8 years ago

ikod commented 8 years ago

Giles Bathgate:

This uri abstraction might be a useful sub component of these http libs: https://github.com/rikkimax/alphaPhobos/blob/master/source/std/experimental/uri.d

GilesBathgate commented 8 years ago

@ikod I am putting together a testsuite to test various uri backends: https://github.com/GilesBathgate/uri This should give an idea of performance and robustness.

ikod commented 8 years ago

I commited ftp code and unittests, will look on uri lib.

ikod commented 8 years ago

What is the best practice for using modules from alpha libraries? Is it ok if I just place it in my source tree?

GilesBathgate commented 8 years ago

ping @wilzbach

wilzbach commented 8 years ago

Why not? (but I don't have detailed experience in best practices for this either) Anyways as long as you haven't reached 1.0, you shouldn't worry about this too much.

GilesBathgate commented 8 years ago

@ikod I would like to say that I am not getting good results from the alphaPhobos library, I am trying vibe.d implementation instead.

wilzbach commented 8 years ago

Is it ok if I just place it in my source tree?

To clarify you mean using git submodules? You can also tell dub to use master of its already released there..

ikod commented 8 years ago

To clarify you mean using git submodules?

Never tried git submodules, but they should work, thanks for idea.

GilesBathgate commented 8 years ago

@ikod Here are some initial results of the various Uri parsing libraries. (A reference implementation was made by wrapping the c library liburiparser)

The test was just a simple one run in a loop 10,000 times

        auto u = new Uri("http://user:pass@host:99/foo/bar?baz#qux");
        assert(u.scheme == "http");
        assert(u.username == "user");
        assert(u.password == "pass");
        assert(u.host == "host");
        assert(u.port == 99);
        assert(u.absolutePath == "/foo/bar");
        assert(u.query == "baz");
        assert(u.fragment == "qux");
GilesBathgate commented 8 years ago

@ikod Here is another test run:

uriparse.d is my attempt at creating a new uriparsing library. It will probably only currently parse the most basic of urls, but its still the fastest ;)

ikod commented 8 years ago

@GilesBathgate Finally pushed http and ftp requests joined under single structure. One of the goal was not to break API and give user unified interface for http and ftp, which at the same time can give different details on responses. I'm not happy with proposed code, and will try to improve it. Anyway if you have any final results on URI tests, I will try to incorporate another URI parser. Thanks.

anton-dutov commented 7 years ago

@ikod, @GilesBathgate What about urld ?