Coder Social home page Coder Social logo

huachao / vscode-restclient Goto Github PK

View Code? Open in Web Editor NEW
5.0K 61.0 420.0 9.44 MB

REST Client Extension for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=humao.rest-client

License: MIT License

TypeScript 96.07% CSS 2.61% JavaScript 1.32%
visual-studio-code rest-api http-client typescript rest http vscode-extension vscode rest-client graphql

vscode-restclient's Introduction

vscode-restclient's People

Contributors

abdulkareemnalband avatar adibradfield avatar badre429 avatar baojd42 avatar d-akara avatar dependabot[bot] avatar elszon avatar flanakin avatar gitter-badger avatar huachao avatar isc-rsingh avatar kibiz0r avatar kronuz avatar lochstar avatar lostintangent avatar mad-mike avatar maximkahuman avatar meir017 avatar mtnrbq avatar mtxr avatar pluwen avatar ricmrodrigues avatar sebastian-fredriksson-bernholtz avatar thebinaryguy avatar theerapatcha avatar treno1 avatar tristan957 avatar vfk avatar viktor-evdokimov avatar wtetsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-restclient's Issues

Unexpected token U

  • VSCode Version: 1.4.0
  • OS Version: Windows 10
  • REST Client Version: 0.7.2

Steps to Reproduce:

  1. Enter GET http://wwww.bing.com HTTP/1.1
  2. Ctrl-Alt-R

I get the error above. I was working find just a few minutes ago so not sure what could be the case.

R.

Correct typo in the responce window

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.6.1

Steps to Reproduce:

  1. Note that output window is called \reponse-prevew.
  2. Is backslash in the beginning is a typo or this was done intentional?

Add loading icon

  • VSCode Version: 1.3
  • OS Version: Win 7

When A request take some time (10s as exemple), we don't really know if the request has been correctly sended and if it just waiting for the answer.
I type ctrl+alt+r 5-6 time because I thought that the request wasn't send.

May be display a loading information (like an update extensions bar on top of VSC) and hide it when it's done.

I just saw that there is a small cloud into the bottom bar and the display the duration.
I don't know if it's very explicit for a loading time. May be add this information into the doc?

POST request without headers fails

  • VSCode Version: 1.4.0
  • OS Version: Windows 10
  • REST Client Version: 0.7.2

Steps to Reproduce:

  1. Create POST request with body but no headers;
  2. Ensure that there is an empty line between request URL and body;
  3. Execute request;
  4. VSCode will show error message Header must be in 'header name: header value' format, please also make sure there is a blank line between headers and body;
  5. Add any valid header;
  6. Ensure that there is an empty line between request URL and body;
  7. Execute request;
  8. Request succeeds.

As I mention, there is a workaround — create dummy (still valid) header and execute request. But behavior is clearly incorrect and error message is misleading.

Unable to make requests from .md file

  • VSCode Version:
    Version 1.7.2
    Commit 7ba55c5860b152d999dda59393ca3ebeb1b5c85f
    Date 2016-11-21T22:14:18.217Z
    Shell 1.3.8
    Renderer 52.0.2743.82
    Node 6.5.0

  • OS Version:
    Ubuntu 16.04

  • REST Client Version:
    v0.11.0

I'm unable to put sample requests in my README.md file to document an API. Here is a small sample of my README.md file:

...

Get a list of all users
-----------------------

GET http://localhost:5000/api/users HTTP/1.1


Create a new user
--------------------

POST http://localhost:5000/api/users HTTP/1.1
content-type: application/json

{
    "name": "Test User"
}

...

Steps to Reproduce:

  1. If I select one of the requests and hit ctrl-alt-r nothing happens.
  2. If I change the file extension to .txt and repeat step 1. The request is made and the response panel opens.
  3. If I change the file extension back to .md and repeat step 1. nothing happens again.

Host header

  • VSCode Version: 1.3.0
  • OS Version: Windows 10.0.10586
GET /api/v1/chat HTTP/1.1
Host: localhost:8084
Content-Type: application/x-www-form-urlencoded

Steps to Reproduce:

  1. Do "Copy request headers" on some call in Chrome Network tab
  2. Paste it to VSCode
  3. Run REST Client
    Result: Invalid URI "/api/v1/chat

Alternative Steps:

  1. Copy Generated HTTP code from Chrome Postman extension
  2. Paste it to VSCode
  3. Run REST Client
    Result: Invalid URI "/api/v1/chat

Expected result: Expected it to take the Host from headers if the path is absolute.

Cannot display the reponse if it cannot format it

  • VSCode Version: 1.3
  • OS Version: Win 7

When the response contain element that cannot be parsed (Php error as exemple), it display the last preview or display an error message : "Unable to open '\response-preview': Unexpected token <."
It would be great to display raw data to be able to read the error.

Cheers

Fonts in `\reponse-prevew` window not following configuration

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.6.1

Steps to Reproduce:

  1. Select none-standard font for VSCode. Example of my settings.json:
// Place your settings in this file to overwrite the default settings
{
    "editor.fontFamily": "Arial, Consolas, 'Courier New', monospace",
    "editor.fontSize": 8,
    "editor.wrappingColumn": 0
}
  1. Note that font has changed in request window;
  2. Execute request;
  3. Note that \reponse-prevew window still uses standard font (see attached screenshot);

illustration

Comments are still integrated to the request

  • VSCode Version: 1.4
  • OS Version: Win 7
  • REST Client Version: 0.7

Comments are integrated in the request.

  • Because you need a blank line between Content-type and Body (in POST request), if I put a comment instead of this blank line, the request will be not send.
  • If I put comment into the JSON body, my server will get that comment as a JSON form and a malformed JSON occur.

2016-08-08 17_18_18-mingw64__c_var_www__files_front_trace
Right side is my server log.

Proposition : Replace the comment with a blank line. BUT in a JSON form, blank line will generate a malformed JSON.

Ignore proxy settings for some hosts

  • VSCode Version: 1.7.1
  • OS Version: Win7
  • REST Client Version: 0.10.2

Steps to Reproduce:

  1. Working behind proxy
  2. Set proxy host and port in VS Code
  3. Start local server.
  4. Send request to localhost (ex. GET http://localhost:8080/update)
  5. Receive "HTTP/1.1 400 Bad Request" response

I suggest the Proxy Excludes option.
If some host(ex. localhost, 127.0.0.1) is in the option, request should not use proxy settings.

Headers are not parsed correctly with LF line endings

  • VSCode Version: 1.5.2
  • OS Version: Windows 7
  • REST Client Version: 0.7.5

Steps to Reproduce:

  1. create a file including rest calls with lf line endings
  2. Execute the call, the Header lines are added to the URI

When I change the line endings to CRLF, everything works as expected

upper case name headers are sended in lower case

  • VSCode Version: 1.5.3
  • OS Version: Linux Mint 18
  • REST Client Version: 0.8.3

Steps to Reproduce:

  1. create a new rest message with specific headers with upper case
    exemple:
POST http://myserver/ws/myapi/v1 HTTP/1.1
Content-Type:application/json
Accept:application/json
Company-Bu-Code:010
TEST:010

{
  "messasge": "0000010001"
}
  1. send the message (ctrl+alt+R)

Problem, the specifics headers are send in lower case:
Company-Bu-Code => company-bu-code
TEST => test

Allow query strings spread into multiple lines

  • VSCode Version:1.3.1
  • OS Version:ubuntu 16.4
  • REST Client Version:0.6.1

Steps to Reproduce:

some queries to api are really lng and writing them in single line is making everything worse
it could be so nice to split parts into lines but when i do this the request wont work

Use cookies

As far as I can see, cookies received by previous requests are not automatically sent with subsequent requests to the same host. Woul it be possible?

Receiving "Running the contributed command:'rest-client.request' failed."

  • VSCode Version: 1.4.0
  • OS Version: Window 10 anniversary update
  • REST Client Version: 0.7.1

Steps to Reproduce:

  1. Open any request file
  2. Execute it (ctrl - alt R)

Hello,

I really love your extension, however, since the latest windows 10 big update (anniversary), it does not work anymore

I tried reinstalling the extension, without any more success.
Is there a way to get logs for you?

Thanks for your help

Use variables inside http/rest files

  • VSCode Version: 1.3.1
  • OS Version: Windows 10.10586
  • REST Client Version: 0.6.1

Requirements:

The goal is to be able to make flexible REST client file. Adding variables, it could be simple to do those sort of things :

Tasks:

  • environment variable (you can define prod/sandbox/... variables)
  • global dynamic variables (I will provide function like {{$guid}}, then you can use this in your request when you needs a new guid) support in the future.

Expand/collapse JSON/XML response body

Format result based on the content type so it is easy to identify components of response.
It would be nice to have expand collapse at node level like in most XML, JSON viewers.

Allow multiple requests per file

  • VSCode Version: 1.3.1
  • OS Version: Windows 10.10586
  • REST Client Version: 0.6.1

Steps to Reproduce:

  1. Create a .rest or .http file
  2. Add multiple HTTP requests
  3. Execute and see nothing happens

Potential solution:

Create an array of HTTP requests based on REST keywords (GET, POST, etc...) and execute each one after another.

Tasks:

  • Group multiple requests in the same file (add new delimiter and way to trigger)
  • Handle array of REST requests from a single file
  • Execute REST requests one after another
  • Add some style to see the separation of responses in the result pane

Proxy support

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.6.2

Steps to Reproduce:

  1. Enter a network environment where an HTTP proxy is required
  2. Make the proxy settings in VSCode's settings.json ("http.proxy": "http://proxy:8080")
  3. Try to make an HTTP request, e.g. 'GET http://example.org/'
  4. There is an error message that says "Error: Error: connect ETIMEDOUT ..."

Given the fact that I can't find any discussions or related code in this project I'm assuming the REST Client currently does not support HTTP proxies.

Wrapping of long strings in output window

It would be nice to have results in response window be wrapped by default. In case if you're having long result string (token, for example) it's very inconvenient to work with such data.

Unable to copy responses to clipboard

Cool plugin for vscode, will be very handy, thanks! One issue I've seen is this:

Not sure if this is an issue with the extension or with VSCode itself... but I am unable to copy responses to the clipboard. This is very useful for copying redirect URL's in 30x http responses from the rest service that is being tested.

Also, would it be possible to have an option to automatically handle 3xx redirect message responses from the server?

Parsing error

  • VSCode Version: 1.4
  • OS Version: 7
  • REST Client Version: 0.7.3

Hi,

I'll try to explain a bit. I got a file that I want to download. I use a get request to do that.
When I put the link into a browser, I can download the file.

2016-08-24 10_54_21-new tab - firefox developer edition

When I put the link into "resteasy" (firefox extension for rest client), I can see the content of the text file.

2016-08-24 10_53_52-rest easy - firefox developer edition
2016-08-24 10_54_01-rest easy - firefox developer edition
When I put the link into vscode rest client, I got the response "Parse Error" displayed down.
2016-08-24 10_55_41-php - gateway_library_dgateway_rest_rest php - zend studio - c__users_sdp_zend_w
2016-08-24 10_55_26- crmat http - gateway - visual studio code
BUT If I had, in php, an "exit()" function just after the file reader, the content if well displayed.
2016-08-24 10_56_02-php - gateway_library_dgateway_rest_rest php - zend studio - c__users_sdp_zend_w
2016-08-24 10_56_10-response - gateway - visual studio code

I don't know what cannot be parsed. May be add a raw functionality. Like display content and do not try to parse it. Or avoid parse if it can't parse?

Thanks

Is it possible to cancel the request?

Not an issue, it's more a question.
Steps to reproduce:

  1. Create a request and run it
  2. Request takes a while to execute
  3. No way to cancel the running request.

Can you add a pane under the results to query elements returned from request with js

Since you are using a webview i think it should be not that difficult to add a input field to write js to play with response .
it would be really great i already replaced this with postman just there are 2 issues i face so far
first is variable support it could be great if variables could be used inside the url and the second is this playing with response.

Consider putting results in a separate pane

Currently we are putting result data to console log, which is poorly structured and has no colorization. Consider converting the result to HTML and preview it in another pane, make sense?

Support Curl -> RFC 2616 conversion

With Postman, I can find a service call in Chrome debuggers network tab, copy the call as curl, import it into Postman, and my method, url, headers and body are all setup for me. HUGE time saver, especially when my QA people need me to reproduce an issue... they just send me that captured curl script.

Be nice if I could paste the same Curl into Restclient and have it generate the RFC 2616 format.

Handle urls with urlencoded query params

  • VSCode Version: 1.5.3
  • OS Version: Win7 64bit
  • REST Client Version: 0.8.5

Steps to Reproduce:

  1. Give a url that is already urlencoded http://example.com.com/api/users/list?params=NC%2CN%2CVL%2CV

Expected that the result will be the same as cur/browser, but instead, it encodes the url again, resulting in the backend receiving NC%2CN%2CVL%2CV instead of NC,N,VL,V

Same issue if encoded values are part of the path instead of just the query string.

P.s: I tried using the dev tools to find the actual request being made, but it does not appear in the network tab. Is there a way to see the actual requests (that doesnt involve sniffing with an external program)

Allow automatic Decode of HTTP responses.

  • VSCode Version: 1.5.2
  • OS Version: W7
  • REST Client Version: 0.7.5

Reception of a response may include encoded characters. Although there are other extensions that will decode html encoded characters, the response is read only. To decode requires an extra set of steps to open a new window, manually select the response (CTRL+A does not work) and past into the new window before invoking the other extension.
Can you provide an option to decode encoded characters in the response?

Thank you.

Can't set "Host"

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.6.1

Steps to Reproduce:

qq 20160725153153

Curl command fails if -u is specified

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.6.2

Steps to Reproduce:

  1. Create a curl command that passes the -u flag with required parameters
  2. run the curl, it will fail with "Unauthorized"

It appears that running the curl command does not process the -u parameters correctly. You can reproduce this if you sign up for a twilio account and call:

curl "https://lookups.twilio.com/v1/PhoneNumbers/+19999999999?CountryCode=US&Type=carrier" -u 'account-SID:account-token'

Response is

HTTP/1.1 401 UNAUTHORIZED 317ms
access-control-allow-credentials: true
access-control-allow-headers: Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since
access-control-allow-methods: GET, POST, DELETE, OPTIONS
access-control-allow-origin: *
access-control-expose-headers: ETag
content-type: application/json
date: Sun, 31 Jul 2016 02:54:20 GMT
twilio-request-duration: 0.002
twilio-request-id: RQb1fa69f4011d45f1bd552952a270a886
www-authenticate: Basic realm="Twilio API"
x-powered-by: AT-5000
x-shenanigans: none
content-length: 205
connection: Close

{
    "code": 20003,
    "detail": "Your AccountSid or AuthToken was incorrect.",
    "message": "Authentication Error - No credentials provided",
    "more_info": "https://www.twilio.com/docs/errors/20003",
    "status": 401
}

Using NTLM authentication

  • VSCode Version: 1.3.1
  • OS Version: Windows 10
  • REST Client Version: 0.5.4

Steps to Reproduce:
Is there a way to use Windows NTLM authentication via the REST client? I'm able to get the response via the python HTttpNtlmAuth library, but curious to see if the same can be achieved via the REST client.

Others enhancements

  • VSCode Version: 1.3
  • OS Version: Win 7

I don't know if it's better to create different issue but here is some proposition and sorry for the english :).

Enhancement :

  • Create a new document with the response content to avoid the white background. To be homogeneous with the application.
  • The scroll bar isn't display. It appear if I change the file tab and back to the content-preview (into same same editor).
  • The content-preview take some time to appear if I change the tab and back in the preview. Not instant at least.
  • Allow to download file as a browser would do or display the content of the file (if possible :))
  • crlt+alt+r send the current line request or until the next GET/POST
    I create a file with some request on each line to test my code and I have to highlight the whole line to send a request:
    GET http://......
    GET http://.....
  • Display error message if the request is not send due to a malformed request.
  • Add collapsible functionality for json and xml?
  • Display the line number?
  • Make at least three # at the beginning of the line as the delimiter

Cannot read property 'trim' of undefined

  • VSCode Version:
    1.7.1
  • OS Version:
    Windows 10
  • REST Client Version:
    0.10.1

Steps to Reproduce:

  1. Run GET request to api returning json payload

Error Message:

Unable to open 'Response(375ms)': Cannot read property 'trim' of undefined.

Add XML response format

  • VSCode Version: 1.3
  • OS Version: Win 7

Enhancement

It could be great to format the answer which have the content-type: application/xml.
foobar
==>

foobar

Show response in separate tabs

Hi,

It would be also nice to have several output windows. Currently you cannot have two input documents that feed their output to two different output windows. You will always have only one response window, and you'll be loosing results of previous requests all the time.

What do you think about such improvement?

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.