main.append(addBanner("Introducing Postman","David Fancher : April 2019","Introduction"))
main.append(addArticle())
constarticle=document.querySelector("article")
article.append(addHeader("Postman: Header and Footer"))
article.append(addSubHeader("The Header"))
article.append(addParagraph("The header contains controls for creating items, importing data, changing workspaces, collaborating, accessing settings and the user profile."))
article.append(addParagraph("If you click on the New button, you wil see the dialog box shown in figure 1. Note that this is version 9.15.10 which is the latest version as at today's date which is April 2nd 2022."))
article.append(addImageWithCaption("images/create_new.png","Figure 1 - the dialog box that appears when you click New in Postman."))
article.append(addParagraph("Notice that there are two categories in the dialog box in figure 1. The building blocks are the basic options you would use to create requests, collections, environments and so on. The Advanced options allow you to create more advanced things such as a mock server, a monitor and so on."))
article.append(addParagraph("In the course video, this dialog box also has tabs for templates and API Network which I assume is because this is an older version of the software. I would assume that the newer version has the same functionality, but that it is accessed in a different way. If it becomes necessary, I will look at the current documentation to find out how to do that."))
article.append(addParagraph("The import button allow you to import previously exported items into a workspace so it is useful for sharing a workspace. You can also click on Workspaces to maanage your workspaces."))
article.append(addParagraph("There are also several button on the top right in the header, most of which are beyond the scope of this course. Two which might be of interest are the settings icon and the account icon. It is a good idea to explore the settings and see what configuration options might be available. The account settings can be useful if you are working with multiple accounts. You can log out from here or explore the account settings."))
article.append(addParagraph("There is also a trash option under the account in the course video (not on my version) which can be useful for recovering a collection, for instance, if you have accidentally deleted it. Collections, like everything else in Postman, are stored on the Postman servers, but if you are using a free account, these are only stored for a day."))
article.append(addSubHeader("The Footer"))
article.append(addParagraph("There are some useful icons in the footer, but again the view is very different in the latest version of Postman. For more information, it would be worth looking at the latest online documentation under <a href='https://learning.postman.com/docs/getting-started/navigating-postman/'>Navigating Postman</a>."))
article.append(addHeader("Postman: Sidebar and Request Builder"))
article.append(addParagraph("The sidebar on the left gives us access to Collections, History and several other useful option. Postman saves our requests in the History, but it doesn't save responses by default. However, there is a switch we can toggle to have it save responses. To do that, we select the History and then click the breadcrumbs at the top of the screen to access the option as shown in figure 2."))
article.append(addImageWithCaption("images/save_responses.png","Figure 2 - the Save Responses toggle."))
article.append(addParagraph("This option can be quite useful if you need to compare respones for different requests."))
article.append(addParagraph("Clicking on Collections in left sidebar gives access to any collections, folders or requests defined in the workspace. There isn't really anything of interest there at the moment, but as the course progresses, we will see more items being added there."))
article.append(addParagraph("There is a filter box at the top of the list we see when we select an item in the left sidebar. For most of these, the list is empty but because I have signed in to Postman and I created some requests, there are a number of items in this list and we can filter these by inserting some text in that filter box. This can be seen in the image in figure 2. In most cases, this will be sufficient to find what you want, but there is also a search box at the bottom of the page if you need it."))
article.append(addParagraph("The main panel in Postman is the Request Builder, and this is where we will be doing most of our work. This is sub-divided into two parts. The top half is where we compose queries so this includes things like the URL, the HTTP method, the authorisation method, the request body and so on. When a query is run, the reponse appears in the lower half and this includes things like the response status code, the time, size, cookies, body and headers."))
article.append(addParagraph("There is an icon in the bottom right corner of the Request Builder which toggles the two pane view. By default, the panes are split horozontally, but if you click the icon, it will switch the view between a horozontal and vertical split. The icon itself looks like a couple of miniature panes and they will show the current option so they will be split in the same way as the request builder and you will see the icon change to reflect the new view option when you click it. This is simply as matter of preference in most cases, but you may sometimes find that it is useful to switch between these views, depending on that you are looking at in the Request Builder."))
article.append(addHeader("Run the Sample API"))
article.append(addParagraph("The exercise files include an API we can use to follow along with the course videos and for the challenges. We need to be able to run the API in order to do that. To do that, the first step is to open a command prompt and naviate to the node directory in the folder that contains the exercise files for this course. For me, the command to do that is"))
article.append(addInset(["cd My Learning\Exercise Files\Ex_Files_Introducing_Postman\Exercise Files\api\node"]))
article.append(addParagraph("You may need to switch over to the drive this directory is on since the dir command in a windows prompt doesn't allow you (as far as I'm aware) to include the drive letter in a cd command. In my case, the files are on my G drive, so that is"))
article.append(addInset(["G:"]))
article.append(addParagraph("I already have node installed so be aware that you may need to install it if you haven't done so already. Before running the API for the first time, you should ensure that all dependencies have been installed with the command"))
article.append(addInset("npm i"))
article.append(addParagraph("We can now start the API with the command"))