cedric05 / dothttp-runner

dothttp is an open-source dev friendly http request tool
https://marketplace.visualstudio.com/items?itemName=ShivaPrasanth.dothttp-code
Apache License 2.0
12 stars 2 forks source link
dothttp-runner dsl hacktoberfest http-client httpclient postman typescript vscode vscode-extension

Http Client for vscode (dothttp-runner)

Install

visit vscode-marketplace or open-vsx and search for dothttp-code

Note:

⚠️⚠️⚠️⚠️ 🗣️ Installing this extenison, downloads & runs binaries from this repository.

Principle / WHY

Invoking http requests is typical job of frontend/backed dev. This extension aims in making http requests in vscode (most loved editor) without loosing privacy (like insomnia/postman, stores collection in remote, needs account and many more).

Main aim is to Save and re-use.

Checkout simple example here

For docs visit here

Features

Http Notebook

Example

example http file

# users.http

#!/usr/bin/env /home/prasanth/cedric05/dothttp/dist/dothttp-cli

# this is comment

// this is also a comment

/*
   this is multi line
   comment
*/

# http file can have multiple requests, name tag/annotation is used to identify
@name("fetch 100 users, skip first 50")

# makes are get request, with url `https://req.dothttp.dev/user`
GET https://req.dothttp.dev/user

# below is an header example, if api_key is not defined, it will be defaulted to `121245454125454121245451`
"Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="

# below is how you set url params '?' --> signifies url quary param
? ("fetch", "100") #
? ("skip", "50")
? projection, name
? projection, org
? projection, location

# makes are post request, with url `https://req.dothttp.dev/user`
POST https://req.dothttp.dev/user

basicauth('username', 'password')
/*
   below defines payload for the post request.
   json --> signifies payload is json data
*/
json({
    "name": "{{name=adam}}", # name is templated, if spcified via env or property, it will be replaced
    "org": "dothttp",
    "location": "Hyderabad",
    # "interests": ["exploring", "listening to music"],
})

# makes put request, with url `https://req.dothttp.dev/user/1`
PUT https://req.dothttp.dev/post

# define headers in .dothttp.json with env
basicauth("{{username}}, "{{password}}")

# posts with urlencoded
data({
    "name": "Adam {{$randomStr}}",
    "org": "dothttp",
    "location": "Hyderabad",
    "interests": ["exploring", "listening to music"],
})

// or use below one
// data('name=Adam+A&org=dothttp&location=Hyderabad&interests=%5B%27exploring%27%2C+%27listening+to+music%27%5D')

Support


Docs and more

Checkout Most Popular http collections here

Checkout other http collections

Checkout docs language for better understanding.

Checkout dothttp(dsl for http).

Checkout playground

view product post here

Vscode alternatives


Non Vscode alternatives