Giter Site home page Giter Site logo

cedric05 / dothttp-runner Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 21.12 MB

dothttp is an open-source dev friendly http request tool

Home Page: https://marketplace.visualstudio.com/items?itemName=ShivaPrasanth.dothttp-code

License: Apache License 2.0

TypeScript 96.67% JavaScript 1.85% CSS 1.48%
vscode-extension http-client vscode dsl dothttp-runner httpclient typescript hacktoberfest postman

dothttp-runner's Introduction

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

dothttp-runner's People

Contributors

cedric05 avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

devbox10

dothttp-runner's Issues

Tests

Currently dothttp has test coverage, where as dothttp-code hasn't.

Explore and add tests

Maintain history

It will be helpful when one wants to go back to old request.

Im still skeptical about who should support it, is it vscode extensions or dothttp.

Im inclined towards vscode

suggestions improvements

current implementation reads from history, it runs on file and is pretty slow. needs fixes

  • suggest urls from other files
  • suggest methods on any line
  • while suggesting infile variables, don't include default value....
  • fast startup

Restart dothttp cli server

  • although giving flexibility to restart, means there are problems with dothttp cli server.

dothttp with certificates uses persistent connections, which would cause when paths are getting changed. For this specific scenario, we want to expose restarting server.

actions on renderer/notebook cell.

  • actions
    • save response in new file
    • open in new untitled view (follow configuration)
    • generate programming language for notebook cells. (currently communication between extension and renderer is cut off, will make changes according to vscode api)

fresh installation issue

/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2084 [[object Object]]Cannot read property 'getProperties' of undefined
$onExtensionRuntimeError @ /usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2084
/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2084 TypeError: Cannot read property 'getProperties' of undefined
	at t.PropertyTree.<anonymous> (/home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2)
	at Generator.next (<anonymous>)
	at /home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2
	at new Promise (<anonymous>)
	at r (/home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2)
	at t.PropertyTree.refresh (/home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2)
	at t.PropertyTree.onActiveEditorChanged (/home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2)
	at /home/aravind/.vscode/extensions/shivaprasanth.dothttp-code-0.0.8/dist/extension.js:2
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at p.acceptDocumentsAndEditorsDelta (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
	at p.$acceptDocumentsAndEditorsDelta (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87)
	at c._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at c._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at c._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at c._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at t._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at l.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65
	at Socket.E (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106)
	at Socket.emit (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/events.js:315)
	at addChunk (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/_stream_readable.js:295)
	at readableAddChunk (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/_stream_readable.js:271)
	at Socket.Readable.push (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/_stream_readable.js:212)
	at Pipe.onStreamRead (/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/internal/stream_base_commons.js:186)
$onExtensionRuntimeError @ /usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2084
DevTools failed to load SourceMap: Could not load content for https://ticino.blob

Screenshot from 2021-04-01 20-06-31

backlog

  • show script output in terminal/output .http users (use httpnotebook)
  • ~~ should only allow single http def in notebook~~ (now multiple targets can be included)
    • any new httpdef should automatically move it to next cell (notebook)
  • multiple execution types? (notebook)
    • where would curl go? (notebook): (option to generate)
  • https://api.adoptopenjdk.net/q/openapi swagger import failure

Provide Suggestions

Current compiler will not be able to do incomplete parsing, without incomplete parsing only few suggestions can be provided.

for now we are focused on suggesting

according to user hover

  • headers (most used headers)
  • hostname and path in current file.

according to defined/history

  • variables (defined in current file)
  • variables (defined in enabled env and enabled properties)
  • special variables (currently dothttp provides only four randomStr, randomFloat, randomBool, randomInt)
  • should not fail, in case of .dothttp.json doesn't exist

dothttp should auto update

Currently whole installation, it downloads binaries from dotextensions-build.
But it will never be updated. It should auto update

show javascript test results

dothttp now provides users to run script after http execution. with this user can write tests, update properties.

  • provide colouring to embedded javascript
  • provide suggestions vscode doesn't support
  • show script output in terminal/output window for users (will be tracked seperately)
  • show update properties from script to file properties.
    • if removed, it should be removed
    • if added it should add
    • if update, it should update
  • show output for notebooks, in seprate data tab.

adding duplicate property value

currently duplicate property is allowed but enable or disable is effecting both, it should only effect one property that, way user can have multiple he can deal with

reuse old vsocde tab

with all use cases in mind.
having to reuse old vscode tab should be user setting.

Disable all env

  • its added earlier somehow broken.
  • toggle commands (only one is showing up in command palate)

MAC easy installable

currently easy installation only works for linux and windows.

building executables are done here.
for available builds visit here.

dothttp notebook

it follows same aspects as microsoft/nodebook or Jupiter notebook.

This change will potentially improve user experience for completely defined workflow for rest of the scenarios.

checklist

  • should be added in history
  • should show error correctly
  • show property view for httpbook
  • show environment view for httpbook
  • auto complete should work as it is
  • properties
  • environment
  • finalise file name extension (will use .httpbook / .hnbk).
  • activate when httpbook is available
  • coloured outputs for json/xml
  • save single output and derive rest of outputs (currently for each execution, html/plain text is used and dothttp rendere. both of them saved, but one can derive from other, which would result in lowering file size)
    • ~~ i'm not sure weather we want it. (adding a backlog)~~ not in scope, we could revisit this
  • show script output
  • show generated properties

http file outline

outline provides easy way to navigate between multiple requests (either via left pane or shortcut)

  • name
    • host (host)
    • path (url path)
    • query (keys list)
    • payload (type)
  • name
    • host (host)
    • path (url path)
    • query (keys list)
    • payload (type)
  • name
    • host (host)
    • path (url path)
    • query (keys list)
    • payload (type)

Save response in seperate folder

Currently request's response is showed in untitled tab with file name set to current file + target.

Where it may be not favorable to all.

From now onwards it drives via configuration.

  • set file name to relative path(configured) of current file.
  • set filename to some other directory configured

This helps keeping http files from responses

expand query params

when ever user enters url
https://somehost.com/?ram=ranga , it would be better if host and params transform to

https://somehost.com/
? ram = ranga

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.