- Overview
- Transcript
4.11 HTTP Requests Within Sublime
I think you'll like this plugin. When testing URLs, sometimes, it can be a pain to switch over to the browser. In this lesson, I'll show you how to accomplish the same thing with a simple keystroke.
1.Introduction1 lesson, 02:05
1.1Welcome02:05
2.Getting Started9 lessons, 35:20
2.1Installation and Base Settings04:54
2.2Services and Opening Sublime From the Terminal02:20
2.3Multiple Cursors and Incremental Search06:54
2.4The Command Palette04:13
2.5Instant File Changing03:19
2.6Symbols04:17
2.7Key Bindings02:33
2.8Installing Plugins Without Package Control02:54
2.9Package Control03:56
3.Snippets3 lessons, 14:40
3.1Your First Snippet09:04
3.2Adding Snippets Through Package Control02:32
3.3Easier Testing With Snippets03:04
4.Essential Plugins12 lessons, 46:58
4.1Zen Coding07:09
4.2Emmet06:52
4.3Cross-Browser CSS With Prefixr02:17
4.4Fetch Files With Ease 04:22
4.5Lightning Fast Folder and File Creation 02:12
4.6Sidebar Enhancements03:09
4.7Sublime Linter02:01
4.8Sexy Code Snippet Management With Gists07:50
4.9DocBlockr03:49
4.10Pretty Task Management02:42
4.11HTTP Requests Within Sublime02:29
4.12LiveReload02:06
5.Tips, Techniques and Modifications8 lessons, 49:09
5.1Regular Expressions in Sublime05:49
5.2Vintage Mode10:46
5.3Quicker Stylesheet References02:30
5.4Joining Lines04:40
5.5Sublime and Markdown with Marked03:10
5.6All About Projects 05:54
5.7Configuring and Mastering Split Windows07:19
5.8Custom Builds09:01
6.Closing1 lesson, 00:49
6.1Conclusion00:49
4.11 HTTP Requests Within Sublime
Let's say I'm working in a framework where I can specify the routes that I want to respond to. Normally, you will set your route, you will respond accordingly, and then maybe you'll view that in the browser to test it. And that certainly works fine enough. But, let me show you a plugin that makes this a little bit easier for quick checks. We will install it through package control, install, and it's called HTTP requester. So now let's try this out. Why don't we do something like this? When the user requests the home page, we're going to grab all of the users. Don't worry about the syntax here, that really has very little to do with this lesson. So we're going to grab the users, and why don't we do response. We're going to add this as eloquent, and I'll send in the users. So now, let's take a look at the manual way of testing to see what this does for us. We run it, and sure enough, we get this little bit of JSON with a couple rows from the users table. But now, I'll show you how to do this directly from the editor. We've installed that Http Requester plug-in, so now check this out. I can add a URL. We'll do Laravel.dev and now I will run this through the plug-in by selecting it and clicking on the Mac, CMD+Option+R. It will immediately create a new tab and show you what was received in response. By the way, if you are a Windows user, this would be CTRL+ALT+R. So let's try another one. Why don't I duplicate this? And now we will say when we wanna grab users/ and then maybe a specific ID. We'll fetch that ID and then we will find the one user that has that specific ID. And we will return once again response eloquent user. So now if you're in the middle of working you don't have to open up the browser. Just quickly run larevel.dev users one and let's run that through the plugin CMD+Option+R. And yep we get a two hundred response and we did return the user with a ninety of one. Now as I understand things at the time of this writing only the get verb is supported. But I believe support for the others is on it's way. Finally, if you can't remember what that shortcut is, it's also available in the right-click menu. So I right-click, Http Requester, and now we do get that result. So if we try to request something that doesn't exist in the edit, we haven't written that one just yet. We run it, and now we do get 404. So that's a helpful reminder when you're in the middle of working and you don't feel like switching over to your browser to try out a specific route.