Using the REST Client within PhpStorm and WebStorm

When building REST-based web APIs, it’s worth having a tool available to invoke them over HTTP. The current versions of WebStorm 6, PhpStorm 6, RubyMine 5.4 and PyCharm contain a bundled REST Client plugin which allows us to do just that.

In this blog post, we’ll have a quick look at the built-in features of the REST Client and on how to use them.

In this post, we’ll be using PhpStorm as our IDE, invoking an API built using the Silex framework which is similar to frameworks like Sinatra and Nancy. The API we’ll be testing using the REST Client plugin is fairly straightforward: it exposes an array of users through a REST endpoint. The /users endpoint returns the entire array of users. The /users/:id endpoint returns a specific user when issuing a GET request and writes a user to the array when issuing a PUT request. The source code for this API is available as a GitHub Gist:

The REST Client can be found under Tools | Test RESTful Web Service. A new tab will be opened which gives us the possibility to craft an HTTP request which will be invoked against our API. We can specify the HTTP method to be used, the host where our API is located, and the path to be invoked. Other than that, we can add header data as well as query string parameters or a request body to be sent to the API.

Upon invoking the request by clicking the green Run button, the REST Client connects to our API and gathers the response data. We can easily inspect the response body as well as the response headers, each available through their own result tab.

To create a user in our API, invoke a PUT request providing JSON data in the request body. We can provide the request body by entering the text or by selecting a file to upload as the body.

Download PyCharm, WebStorm 6 Preview, or the latest PhpStorm 6 EAP build and let us know what you think!

Develop with pleasure!
– JetBrains Web IDE Team

This entry was posted in Cool Feature, PhpStorm and tagged , , , , . Bookmark the permalink.
  • Zyava

    Text on screenshots is almost unreadable :(

    • Mikhail Vink

      Have you tried clicking on it to zoom? Can read it normally..

  • Nicole Cordes

    Would be cool if you have the opportunity to define the method to be sent to the server as for example a Varnish system you need PURGE and/or BAN method (usually). Is there any way to extend the methods?

    • Mikhail Vink

      Currently it should be implemented within the REST Client Plugin, no opportunity to add the method in settings or somewhere else.. Feel free to request this feature in our issue tracker at

  • AVEbrahimi

    Seems useful!

  • Marco

    Looks nice, but what about Webstorm? Modern Web Apps are using REST services very heavily!

  • Christoph Walcher

    Will this feature be available in webstorm too? Seems quite useful for node rest API development…

  • Maciej

    Very good tool. However 😉 if there’s function to store a different request and select them to run test against different services quickly I won’t have to run JMeter too often :)

  • Andreas Eigenmann

    +1 for Support in WebStorm. Very very useful for node.js development!

  • Mathias Hertlein

    That’s a cool feature! It would be nice if it would be coupled with debugging somehow.

  • Soz Nov

    But, what about http basic authorization?

    • Konstantin Bulenkov

      You have to do it manually now. But that’s a good idea to make it as simple as entering your credentials. Could you please file a feature request?

  • Igor Sutton

    This would be useful in AppCode as well.

  • ksafonov

    REST client with be included in WebStorm installation since the next public build (essentially tonight)

  • Fabio

    What about other IDEs? I’m using PHPStorm and RubyMine, will this (very useful) feature be included also in other products?

    • Bertrand Dunogier

      It is included in PhpStorm EAP, @Fabio, I’m using it right now.

    • Maarten Balliauw

      Feel free to request it to be bundled in your favourite IDE – our issue tracker is at (select the IDE from the top-left menu)

  • Kiview

    Will this be or is this available as a plugin for IDEA as well?

  • Bertrand Dunogier

    Good addition. But unless I’m mistaken, it is not possible to save preconfigured requests, is it ? This would really make it more useful.

  • Edgar Martinez

    How about for testing API’s that require authentication?

    • Bertrand Dunogier

      You can manually add the headers your API will use, depending if it’s cookie, basic, oAuth…

      Higher level integration would of course be better 😉

  • Maarten Balliauw

    Feel free to request a feature in the issue tracker at

  • Pingback: WebStorm 6 Public Preview Build | WebStorm & PhpStorm Blog()

  • Arno.Nyhm

    Yes! IDEA and RubyMine and AppCode would be nice

  • Mike Schinkel

    This is really exciting that you’ve provided this REST Client. I just tried it out and I’m hopeful.

    However, there are two things that I think it really needs, and one is an obvious deficiency:

    1.) It needs to be able to trigger the PhpStorm debugger so that we can trace through the code implementing the web service.

    2.) It also needs a way to save off a “session” complete with method, host/port, path, headers, query parameters and request body. What would be awesome is if the rest client could be configured to look in a directory for JSON files that would contain this information which would allow us to save them using the UI and/or to edit or create them by hand using the editor or even in an automated fashion.

    I’m going to add both of these as feature requests.

    • Mike Schinkel
    • Arash Dalir

      for your first issue, I know that this is not a perfect fix, but consider sending XDEBUG_SESSION_START=XXXXX on the path!
      you can run the debugger and then using the provided session key (e.g 12345) you can set the rest client as such an example:

      method: get
      path: rest/do/something?XDEBUG_SESSION_START=12345

      and then set everything else needed. the debugger will be triggered upon receiving the proper info; just as if it was triggered from a browser…

      • Maarten Balliauw

        That’s a good suggestion, thanks!

  • Pingback: WebStorm 6 – HTML5/CSS3/JavaScript IDE now with TypeScript, CoffeeScript and Dart support | techscouting through the java news()

  • Arash Dalir

    Has anybody tried to upload a file with this really helpful extension? I’m capable of uploading the file and the $_FILES gets filled, but the problem is that in the $_FILES array, each entry name must be relevant to a field name on the form, and there seems to be no way to define the field name for the uploaded file in this extension. Or is it? Could anyone tell me how to bind an uploaded file to a specific field name?
    Also, is there anyway to upload multiple files at the same time?

  • Christian Tonka

    Seriously, why do most rest clients not offer the ability to set Basic authentification data directly. It is really not convenient to base64 encode the username:password myself every time I want to try something out. And a lot of modern APIs require this information.

  • Pingback: Новости » Blog Archive » Новый PhpStorm 6.0 облегчает работу с Composer и другими инструментами()

  • Pingback: Новости » Blog Archive » Новый PhpStorm 6.0 облегчает работу с Composer и другими инструментами()

  • Pingback: Новости » Blog Archive » Новый PhpStorm 6.0 облегчает работу с Composer и другими инструментами()

  • Sapher

    Hello everyone. I spent the whole day to use the brand new REST Client tool, But I think something is missing. In the response headers, I can’t see the HTTP Status code, Is there a way to get it or this feature doesn’t exist at all?

    • Mikhail Vink

      I can see the HTTP Status code under the Response box (Response tab) e.g. “Response code: 200(OK); Content-length….” or in Response Headers tab e.g. “Status: 200 OK”.

    • Adrian Rudnik

      As stupid as it sounds, I got the same error yesterday. Clean PhpStorm installation on Windows and I gave up. Today i figured out that the REST Client tool is not sized correctly in height. You have to drag it a bit up to see the bottom line containing the status response code. The only reason why I noticed that: the outputs seemed to be truncated at the end (last line was always missing) and there is NO indication that there is more content at the bottom of the tool.

  • Pingback: Дайджест интересных новостей и материалов из мира PHP за последние две недели №24 (11.08.2013 — 25.08.2013) | Juds()