gleam-lang / http Goto Github PK
View Code? Open in Web Editor NEW🕸️ Types and functions for HTTP clients and servers!
Home Page: https://hexdocs.pm/gleam_http/
License: Apache License 2.0
🕸️ Types and functions for HTTP clients and servers!
Home Page: https://hexdocs.pm/gleam_http/
License: Apache License 2.0
request.set_header/3
lowercases the header value before adding it to the request record. This can easily break some common use cases such as using bearer token authentication.
Maybe the intent was to lowercase the header key, instead of the value, like prepend_header
does?
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
Many of the functions in this library do not have unit tests. Let's add them!
Reminder to push a release to hex.pm
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
For the same logic as this change #14
I'm not sure how to resolve this in rebar land.
Is it possible to specify this library works with stdlib 0.10.1
and 0.10.0
Missing the ability to fetch cookie information from a response.
Should ignore unknown attributes as specified in spec
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
request.new("https://example.com")
Panics if the URL string is invalid.
/one/two?three=four#five
Should return
["one", "two"]
@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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.