GithubHelp home page GithubHelp logo

idris-http's Introduction

Hi there ๐Ÿ‘‹

I'm uwap (they/them) and I do Nix, Haskell and TypeScript.

idris-http's People

Contributors

artagnon avatar dretch avatar ranlvor avatar relrod avatar uwap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

idris-http's Issues

Travis still doesn't wait

As of #6 we had a fix ensuring travis gets output all the time so it doesn't terminate after 20 Minutes. Though after merging the PR at seems that it still terminates after 20 Minutes making it really lucky if idris itself compiles. At least #6 does caching allowing us to use the same binary (for idris) as long as we have the latest version cached. Some ways we discussed to solve this was providing a PPA with idris nightly or idris releases. Another way would be to manually download a precompiled idris from one of our servers. There is still no way that seems to work completely without either having luck or pulling a binary version of idris in.

Chunked Encoding doesn't work yet

When it comes to transfer encodings idris-http lacks a lot of features. Chunked Encoding is a special case that needs special review. With chunked encoding we are bound to counting bytes. The String type doesn't have the ability to check a length in bytes. That is a huge problem.

Idea 1: ByteString
We could just start making a ByteString library to support it. We would have one large problem with it: We would need to get TCP libraries to use them. Then chunked encoding wouldn't be too much magic here.

Idea 2: Do awkward requests
We could start reqeusting single bytes over TCP and then finally when we get to chunked encoding we request the nujmber of bytes of the next chunk. This is an awful implementation that I wouldn't like to support.

Are there any other ways to go?

URLs are always sent in absolute form (http://example.com/a/b/c), but normally only the path is required (/a/b/c)

It seems absolute URLs in request lines should only be sent to proxy servers [0], but idris-http always sends them regardless.

This is a problem for me because the webserver I am talking to (https://github.com/mozilla/geckodriver) does not accept them.

Can URLs always be sent in relative form instead? I can send a pull-request if you agree.

[0] https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html (section 5.1.2)

There is no way of sending a body with a request

Http.httpRequest accepts Request a, where a is the type of the body of the request, but there is no way of passing a value for the body such that it gets sent in the request.

Do you have an idea for how this is supposed to work?

In my local hacked version I have just got rid of the type parameter from Request, and changed the type of requestBody into String -- but this is possibly not what you want (and really a byte array would be better than String)

Unable to parse output of `www.google.com`

This test:

simpleRequestTest : String -> IO ()
simpleRequestTest testName = do
  Right response <- simpleHttp "www.google.com" 80 "/" | Left err => failed testName err
  if Strings.isInfixOf "google" $ responseBody response then ok testName
  else failed testName "`google` not found within response"

fails with:

At 16:11738:
	crlf new-line
At 16:11738:
'	character '
At 16:11738:
	a different token

Unable to build with Idris v0.12.3

Hi,

I'm unable to build / install this library with Idris v0.12.3:

Can't find import Classes/Verified

Class.Verified was renamed to Interfaces.Verified in idris-lang/Idris-dev@c3f0755 but just renaming the import didn't do the job for me.

In idris-lang/Idris-dev@f754d9c, VerifiedMonad changed from

monadRightIdentity : (mx : m a) -> mx >>= Monad.return = mx

to

monadRightIdentity : (mx : m a) -> mx >>= pure = mx

resulting in the following error:

./Http/RawResponse.idr:58:22:
When checking right hand side of Interfaces.Verified.Http.RawResponse.RawResponse implementation of Interfaces.Verified.VerifiedMonad, method monadRightIdentity with expected type
        MkRawResponse _ >>= pure = MkRawResponse _

Type mismatch between
        MkRawResponse _ = MkRawResponse _ (Type of Refl)
and
        pure _ = MkRawResponse _ (Expected type)

Specifically:
        Type mismatch between
                MkRawResponse _
        and
                pure _

I would have loved to resolve this myself and open a PR, but unfortunately, I was not able to detect the error in question. (I'm still quite new to the language)

Thank you for looking into this.

Fix Travis

Travis fails all the time because it is running in some timeouts. I assume there is a way to fix this.

Cookies

We need to implement cookie support for the initial release.

Implementation Details
Since for now we see header fields as a SortedMap String String (which I would like to change to some case-insensitive type in the future) a cookie header field that can appear multiple times wouldn't fit in that scheme so I suggest making a special case just for cookies and providing some cookie jar type that is a monoid so we can append new cookies on it. I would suggest implementing cookies after RFC6265.

Travis Broken

Travis is broken. An alternative to installing idris via cabal would be using nix to install and build idris-http.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.