cURLit
You’ll find into this repository examples of how to make simple HTTP requests in many programming languages.
The goal is to provide snippets to make simple HTTP request with builtins modules/functions of each language!
Nix
You can test and reproduce all snippets locally if you have Nix
installed
in your system!
Installation steps and guides can be found at https://nixos.org/!
Once you have Nix
installed you can build a complete dev environment with nix-shell
command
executed on folder root.
Warning
All code snippets tries to be updated in syntax and follows language idioms.
If you want to add older versions examples, feel free to open a PR!
Basic cURL
curl -X <method> -H <headers> -d <body>
The default method is GET
!
Body parameter only will work for PUT
, POST
or PATCH
requests!
Table of Contents
- Javascript/NodeJS (fetch/request)
- Go (http)
- Elixir (httpc)
- Python (request)
- Ruby (Net::HTTP)
- Haskell (Network.HTTP)
Roadmap
- [ ] Create other HTTP verbs snippets
- [ ] Add more programming languages snippets
- [ ] Add a detailed README to each language folder
Contributing
- To add a new type of request, create a new branch as:
lang/verb
!Example:
elixir/post
- If you want to apply a correction or suggest a different way
to make an existing request, create a new branch as:
lang/verb-vx
wherex
is a number of the “version”Example: Haskell
GET
request already exist, so it’s version is 1. New branch ->haskell/get-v2
- Remember to add your language compiler/interpreter into
shell.nix
! You can find the most updated versions of packages at https://search.nixos.org/packages/