Code Monkey home page Code Monkey logo

http's People

Contributors

adz avatar bcpeinhardt avatar blond11516 avatar crowdhailer avatar cschembor3 avatar dmmulroy avatar gazler avatar j3rn avatar jwsonic avatar lpil avatar michallepicki avatar nwjlyons avatar ryan-haskell avatar scripttease avatar sporto avatar weizhliu 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  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  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  avatar

http's Issues

Conflicting `None` definitions

The http module imports None from option.
And also defines SameSitePolicy.None.
When trying to run the tests I get:

error: Type mismatch
    �� /home/sebastian/Source/sporto/http/src/gleam/http.gleam:151:15
    �
151 �     userinfo: None,
    �               ^^^^

Expected type:

    Option(String)

Found type:

    SameSitePolicy

Missing tests

Many of the functions in this library do not have unit tests. Let's add them!

Add an origin function.

This might be a bit beyond the scope of this library but I always end up creating the following function. The purpose is to find the origin of a request, falling back to the referer header if origin is not present.

browsers may not send the Origin header, as in the following cases:

img tags will not send Origin headers unless the crossorigin attribute is set>
Chrome and Safari will not send Origin headers with same-origin GET requests
Firefox will not send the Origin header with any same-origin requests (bug)
Firefox will not send the Origin header with cross-origin form POSTs (bug)

However, in all of these cases, the browser does send a Referer header. We can make use of the Referer header, which browser-initiated requests may not spoof, in place of the missing Origin header

I would call it http.get_req_origin

Add a `get_resp_cookie`

Missing the ability to fetch cookie information from a response.
Should ignore unknown attributes as specified in spec

Documentation example imports gleam/elli

gleam/elli is referenced, but there is no link to where you get this module.
I don't know how close this project is to being on hex, but even a link to the github project would be helpful

Scope of this library, stdlib integration

Stdlib inclusion

@lpil mentioned that I should use this library so that I was using a standard HTTP method type.
Probably the only way I would find this type was if it was in standard lib. It's so small I am very likely to just re-implement. Also if there is something that it is expected everyone should use then is that not an argument for inclusion in stdlib?

What shouldn't this library do?

This question I think should be fairly similar regardless of if it will be included in stdlib or not, an http library on the gleam-lang repo will become the defacto standard

I am currently working on a Request and Response Type in midas, and the set of associated utilities e.g http.get_header, http.set_header etc. Would you be interested in a PR to add these to this project?

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.