fetch's People
fetch's Issues
Switch to lwt?
Issue when remote server yields 301 (HTTPS-support)
Hey again @anuragsoni, thanks for this neat library!
This could be an error on my part, but it looks like there's an issue when the remote-server yields a 301.
e.g.
Lwt_main.run(
{
let uri = Uri.of_string("https://swapi.co/api/people/1/");
switch%lwt (Fetch.get(uri) |> Fetch.run) {
| Ok({Fetch.body, Fetch.res}) =>
Httpaf.Headers.to_string(res.headers) |> print_endline;
print_endline(res.reason);
print_endline(body);
Lwt.return();
| Error(_) =>
print_endline("Error");
Lwt.return();
};
},
);
yields:
CF-RAY: 4e9e85698f0ddac4-ARN
Server: cloudflare
Location: https://swapi.co/api/people/1/
Expires: Thu, 20 Jun 2019 15:44:30 GMT
Cache-Control: max-age=3600
Connection: keep-alive
Transfer-Encoding: chunked
Date: Thu, 20 Jun 2019 14:44:30 GMT
Moved Permanently
I seem to experience it when hitting services hosted on https://zeit.co as well.
Use esy for development
Simplifies development experience when depending on unpublished packages.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.