DEV Community

Ajeeb.K.P
Ajeeb.K.P

Posted on

Requester: modern, team-oriented HTTP client for Sublime Text 3

Introduction

We might want to send arbitrary number of GET,POST,PUT etc. requests to test our website/APIs.

You might be using Postman, Paw or insomnia.rest. Those are cool. But, same can be achieved in a different view as well. Hint: It's super-fast, lightweight.

Yeah. This super cool stuff. You can just install and start in seconds. In case you are too curious here are few features.

Features

  • Easily set request body, query params, custom headers, cookies
  • Support for sessions, authentication
  • Forms and file uploads, Wget-style downloads
  • HTTPS, proxies, redirects, and more
  • Full GraphQL support.
  • Catch more of them at Requester Homepage

Installation

  1. Download and install Sublime Text 3.
  2. Install Package Control for Sublime Text.
  3. Open the command palette shift+cmd+p and type Package Control: Install Package.
  4. Search for Requester (not Http Requester) and install it.

The catch

It's not that fancy UIs. It's been with a little bit code.

Show me: The hello world

  1. Open Sublime Text 3. Just copy, any website link and past into a new editor tab. Here is one I copied. http://httpbin.org/get
  2. Look for Requester: Run Requests in the command palette shift+cmd+p and hit Enter. A response tab will appear, with a detailed view of result of the requests.
  3. Congrats! You successfully sent a get request.

In case, you didn't cut with above steps. Just head on to official site (https://requester.org/) and just follow the docs. Trust me, it's really easy and beautiful.

Need syntax highlighting ?

Set Syntax: Requester in the command palette shift+cmd+p and hit Enter.

POST request ?

Yeah. It's also simple.

requests.post('http://httpbin.org/post')

Note: This tool is inspired by python-requests

Too much to type ? Here is a shorter form.

post('http://httpbin.org/post')

More than one ? Why not ?
Select more than one and Requester: Run Requests (There is a shortcut, I leave it for you to grab the official docs :-) ).

post('http://httpbin.org/post')
get('http://httpbin.org/get')
Enter fullscreen mode Exit fullscreen mode

JSON Formatting ?

Yes. please.

get('http://headers.jsontest.com/', fmt='indent_sort')
get('http://headers.jsontest.com/', fmt='indent')
get('http://headers.jsontest.com/', fmt='raw')
Enter fullscreen mode Exit fullscreen mode

Request Body, Query Params, Custom Headers, Cookies

post('httpbin.org/post', data={'key1': 'value1', 'key2': 'value2'})

post('httpbin.org/post', json=[1, 2, 3])
post('httpbin.org/post', json={'name': 'Jimbo', 'age': 35, 'married': False, 'hobbies': ['wiki', 'pedia']})

get('httpbin.org/get', params={'key1': 'value1', 'key2': 'value2'})

get('httpbin.org/headers', headers={'key1': 'value1', 'key2': 'value2'})

get('httpbin.org/cookies', cookies={'key1': 'value1', 'key2': 'value2'})

get('httpbin.org/redirect-to?url=foo')  # response tab shows redirects
Enter fullscreen mode Exit fullscreen mode

Pro Tip

You can save these requests as files in *.pyr. As Sublime Ninja, you can use Ctrl+P for quick accessing. git for versioning etc.

Conclusion

Requester is an easy to use Sublime Text 3 plugin.

Top comments (0)