{"id":18258,"date":"2020-09-04T16:00:21","date_gmt":"2020-09-04T16:00:21","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=18258"},"modified":"2021-10-29T06:55:42","modified_gmt":"2021-10-29T06:55:42","slug":"use-postman-in-laravel-project","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/use-postman-in-laravel-project\/","title":{"rendered":"Use Postman in Laravel Project."},"content":{"rendered":"\n<p>So here&#8217;s what we&#8217;re going to build, a RESTful service, which allows you to sign up as a user, and then create meetings, sign up for meetings, and<br>register for meetings, delete a meeting, or change meeting. So a little organizer-like application.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"231\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/first.png\" alt=\"\" class=\"wp-image-18260\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/first.png 767w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/first-300x90.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/figure>\n\n\n\n<p><br>Here, I&#8217;m on the route of creating a new user, and make sure that later on in this course when you try this on you own application we&#8217;re building<br>throughout this course, to change the URL you see here to the URL pointing to your RESTful server, or to your server hosting create a new user,<br>which is why I have the Post method selected here.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"769\" height=\"257\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/second.png\" alt=\"\" class=\"wp-image-18262\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/second.png 769w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/second-300x100.png 300w\" sizes=\"auto, (max-width: 769px) 100vw, 769px\" \/><\/figure>\n\n\n\n<p> And also, later in another article, make sure to provide one extra post. Besides the Content-Type, which is application\/JSON, make sure to provide the X-Requested-With header with a value of XMLHttp Request. This is required by Laravel to handle your requests correctly, especially when it comes to things like validation and returning errors.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"271\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/third.png\" alt=\"\" class=\"wp-image-18263\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/third.png 771w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/third-300x105.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/third-768x270.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/figure>\n\n\n\n<p>Here for creating a new user, I pass a Post body, so a JSON object where I pass the name of the user I want to create, and email, and a password.<br>Now if I click Send, you see that I also get a JSON response where, well, I&#8217;m told that the user was created. I can then use this user to sign in this route,<br>and pass in the credentials I just created, which returns me a JSON token, which is the security mechanism used in this course.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"258\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/forth.png\" alt=\"\" class=\"wp-image-18264\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/forth.png 748w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/forth-300x103.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"995\" height=\"364\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/fifth.png\" alt=\"\" class=\"wp-image-18265\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/fifth.png 995w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/fifth-300x110.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/09\/fifth-768x281.png 768w\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" \/><\/figure>\n\n\n\n<p>And of course, you will learn more about this in my upcoming articles. And with that, I&#8217;m for example, able to create a new meeting bypassing<br>the token with the request, passing some meeting data like the time when I want this meeting to happen, a name, and a description,<br>I&#8217;m going to click send here; this actually creates such a new meeting. Now I&#8217;m not going to go through all these routes here, but I think you get<br>the idea of what this application does, and how it works. And I&#8217;m very excited to get started with that.<\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_66701\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_31596\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_66701\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>So here&#8217;s what we&#8217;re going to build, a RESTful service, which allows you to sign up as a user, and then create meetings, sign up for meetings, andregister for meetings, delete a meeting, or change meeting. So a little organizer-like application. Here, I&#8217;m on the route of creating a new user, and make sure that&#8230;<\/p>\n","protected":false},"author":14,"featured_media":18251,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-18258","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/18258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=18258"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/18258\/revisions"}],"predecessor-version":[{"id":24551,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/18258\/revisions\/24551"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/18251"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=18258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=18258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=18258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}