Calling REST APIs From the IDE

Published Feb 09 2022 03:36 PM 2,202 Views
Microsoft

Developers use a lot of URLs: your app’s URLs, URLs for consumed services, etc. These URLs, and sometimes their payloads may differ per environment. And as a dev you’re going to constantly hit them. Developers have relied on utilities outside the IDE to track the URLs, send test payloads to the URLs, and inspect the  response. Now you can do all of that from your IDE! To do this we’ll use the REST Client extension for Visual Studio Code.

 

Get Started

  • Click here to Install the extension.
  • Make our first call.
  • Create a new file called client.rest with this content

 

 

 

### First Test
GET http://microsoft.com HTTP/1.1

 

 

 

As soon as you save, you’ll see a Send Request button appear right after the ###.

SameerDoshi_1-1644444713008.png

 

Click send request and you’ll see the response right in the IDE.

SameerDoshi_2-1644444713015.png

 

That’s it! No need to open a web browser, debug tools, networking, and then inspect responses- it’s all right there!

 

If you want to share the response - you can save, copy/paste, or explore the response at your leisure! 

 

Want to share everything you’ve done so far? Simply add the client.rest file to source control and anyone who opens it will run the same call as you just did. But, of course, we’re just getting started!

 

POST Requests With JSON Payload

We can add as many URLs to this file, or we can create other files with a .rest extension.  For now let’s add to our existing file.  Multiple calls are separated by a new line starting with ###

 

Add a post request by adding a ### to the bottom of the file..  Just add ### to add additional requests.

 

As you’d expect you can use <ctrl>+ space to autocomplete all entries. 

 

 

 

###
POST https://localhost:5001/api/Patient HTTP 1.1
Content-Type:  application/json

{

    "name":"H. Simpson"

}

 

 

 

 

Click Send Request and you’ll get a response. You can imagine having a file called services.rest that describes the payload and urls for each of your dependent services, and another file called app.rest that describes the URLs and payloads for your app’s URLs! But if we have many URLs we might want to change the host depending on the environment.

 

Variables

You can add variables in the same client.rest file using the syntax

@<variable name> = <variable value>

 

Then you can place the variable by using {{variable name}} anywhere in the rest of the file.

If you want the variable to refer to a specific request simply put the variable declaration inside the ###.

 

You can also store variables at the environment level (esp. useful if you want to avoid checking in secrets to source control).

 

 

 

@host=microsoft.com

### Get Base

GET https://{{host}}

### Post Base

@patientid=1234

POST https://localhost:5001/api/Patient/

Content-type: application/json

{

   Id:{{patientid}}

}

 

 

 

FHIR Sample

This is great for development but it makes developing against FHIR endpoints incredibly easy.

Take a look at this example

 

 

 

### Get single patient

@patientid=f5e7ee94-bfc6-465e-a64d-f0c90e3d50f5

GET https://{{fhirname}}.azurehealthcareapis.com/Patient/{{patientid}}

Authorization: Bearer {{auth.response.body.access_token}}

 

 

 

This gets a single patient resource. Why is this better than a Postman collection? You can easily check it into source, you can easily edit it without having to click around the Postman GUI, and most importantly- you can quickly copy paste the request or response since it’s all text.

 

Please see the example client.rest included in the Open Hack for FHIR.

This example includes queries for getting a token, fetching a patient, and fetching a list of patients!

 

Benefits

Using the REST Client has many benefits. But chief among them is speed. If you use an external tool, you’ll have to alt-tab to it while you develop. You’ll have to be trained, and train others on it. With REST Client- you only need to know how to use the same IDE you already know and love!

  • Stay in the IDE – stop the context switching. Dev and test from the same place.
  • Document All URLs your app uses  - No more bookmarks or comments in code- just document the URLs as you dev
  • Store URLs next to your code – Since everything is in simple plain text files, as you change and modify your .rest files you’ll be able to easily track the differences.
  • Quickly Test URLs – a year after you stop working on a project- you simply open the text file and hit “send request” to send a request. No more importing and setting up an environment.
  • Inspect Responses As Text Files – use all the tools of VS Code  to look through the response: collapse/expand, find, regex.
  • Save/Share Responses – No more screenshots of browser dev tools- simply send others the entire response payload.
  • Code Spaces Compliant

Postman still has features that you won’t find anywhere else, but for most day-to-day app dev use cases you’ll  find REST client extension in Visual Studio Code meets your needs.

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3145949%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3ECalling%20REST%20APIs%20From%20the%20IDE%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3145949%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EDevelopers%20use%20a%20lot%20of%20URLs%3A%20your%20app%E2%80%99s%20URLs%2C%20URLs%20for%20consumed%20services%2C%20etc.%20These%20URLs%2C%20and%20sometimes%20their%20payloads%20may%20differ%20per%20environment.%20And%20as%20a%20dev%20you%E2%80%99re%20going%20to%20constantly%20hit%20them.%20Developers%20have%20relied%20on%20utilities%20outside%20the%20IDE%20to%20track%20the%20URLs%2C%20send%20test%20payloads%20to%20the%20URLs%2C%20and%20inspect%20the%20%26nbsp%3Bresponse.%20Now%20you%20can%20do%20all%20of%20that%20from%20your%20IDE!%20To%20do%20this%20we%E2%80%99ll%20use%20the%20%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3EREST%20Client%26lt%3B%5C%2FA%26gt%3B%20extension%20for%20%3C%2FA%3E%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fcode.visualstudio.com%2FDownload%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3EVisual%20Studio%20Code%26lt%3B%5C%2FA%26gt%3B.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId--2135623138%5C%26quot%3B%22%20id%3D%22toc-hId--2135599152%22%20id%3D%22toc-hId--2135599152%22%20id%3D%22toc-hId--2135599152%22%3EGet%20Started%26lt%3B%5C%2FH1%26gt%3B%5Cn%3CUL%3E%5Cn%3CLI%3EClick%20%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3Ehere%26lt%3B%5C%2FA%26gt%3B%20to%20Install%20the%20extension.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3EMake%20our%20first%20call.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3ECreate%20a%20new%20file%20called%20%3CEM%3E%3CSTRONG%3Eclient.rest%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20with%20this%20content%26lt%3B%5C%2FLI%26gt%3B%5Cn%26lt%3B%5C%2FUL%26gt%3B%5Cn%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-applescript%3D%22%22%3E%3CCODE%3E%23%23%23%20First%20Test%5CnGET%20http%3A%2F%2Fmicrosoft.com%20HTTP%2F1.1%5Cn%5Cn%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%5Cn%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EAs%20soon%20as%20you%20save%2C%20you%E2%80%99ll%20see%20a%20Send%20Request%20button%20appear%20right%20after%20the%20%3CSTRONG%3E%23%23%23.%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346880i7C841DAF70C1FCD2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%22SameerDoshi_1-1644444713008.png%22%20alt%3D%22%5C%26quot%3BSameerDoshi_1-1644444713008.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EClick%20%3CEM%3E%3CSTRONG%3Esend%20request%26nbsp%3B%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3Band%20you%E2%80%99ll%20see%20the%20response%20right%20in%20the%20IDE.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346881iFECE10572EF30EF3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%22SameerDoshi_2-1644444713015.png%22%20alt%3D%22%5C%26quot%3BSameerDoshi_2-1644444713015.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EThat%E2%80%99s%20it!%20No%20need%20to%20open%20a%20web%20browser%2C%20debug%20tools%2C%20networking%2C%20and%20then%20inspect%20responses-%20it%E2%80%99s%20all%20right%20there!%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20share%20the%20response%20-%20you%20can%20save%2C%20copy%2Fpaste%2C%20or%20explore%20the%20response%20at%20your%20leisure!%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EWant%20to%20share%20everything%20you%E2%80%99ve%20done%20so%20far%3F%20Simply%20add%20the%20%3CEM%3E%3CSTRONG%3Eclient.rest%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20file%20to%20source%20control%20and%20anyone%20who%20opens%20it%20will%20run%20the%20same%20call%20as%20you%20just%20did.%26nbsp%3BBut%2C%20of%20course%2C%20we%E2%80%99re%20just%20getting%20started!%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId-351889695%5C%26quot%3B%22%20id%3D%22toc-hId--2135599152%22%20id%3D%22toc-hId--2135599152%22%20id%3D%22toc-hId--2135599152%22%3E%26nbsp%3B%26lt%3B%5C%2FH1%26gt%3B%5Cn%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId--1455564768%5C%26quot%3B%22%20id%3D%22toc-hId-351913681%22%20id%3D%22toc-hId-351913681%22%20id%3D%22toc-hId-351913681%22%3EPOST%20Requests%20With%20JSON%20Payload%26lt%3B%5C%2FH1%26gt%3B%5Cn%3CP%3EWe%20can%20add%20as%20many%20URLs%20to%20this%20file%2C%20or%20we%20can%20create%20other%20files%20with%20a%20.rest%20extension.%26nbsp%3B%20For%20now%20let%E2%80%99s%20add%20to%20our%20existing%20file.%26nbsp%3B%20Multiple%20calls%20are%20separated%20by%20a%20new%20line%20starting%20with%20%3CSTRONG%3E%23%23%23%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EAdd%20a%20post%20request%20by%20adding%20a%20%3CSTRONG%3E%23%23%23%26lt%3B%5C%2FSTRONG%26gt%3B%20to%20the%20bottom%20of%20the%20file..%26nbsp%3B%20Just%20add%26nbsp%3B%3CSTRONG%3E%23%23%23%26lt%3B%5C%2FSTRONG%26gt%3B%20to%20add%20additional%20requests.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EAs%20you%E2%80%99d%20expect%20you%20can%20use%20%3CEM%3E%3CSTRONG%3E%3CCTRL%3E%2B%20space%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20to%20autocomplete%20all%20entries.%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FCTRL%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-applescript%3D%22%22%3E%3CCODE%3E%23%23%23%5CnPOST%20https%3A%2F%2Flocalhost%3A5001%2Fapi%2FPatient%20HTTP%201.1%5CnContent-Type%3A%20%20application%2Fjson%5Cn%5Cn%7B%5Cn%5Cn%20%20%20%20%5C%22name%5C%22%3A%5C%22H.%20Simpson%5C%22%5Cn%5Cn%7D%5Cn%5Cn%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%5Cn%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EClick%20Send%20Request%20and%20you%E2%80%99ll%20get%20a%20response.%20You%20can%20imagine%20having%20a%20file%20called%20%3CEM%3E%3CSTRONG%3Eservices.rest%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20that%20describes%20the%20payload%20and%20urls%20for%20each%20of%20your%20dependent%20services%2C%20and%20another%20file%20called%20%3CEM%3E%3CSTRONG%3Eapp.rest%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20that%20describes%20the%20URLs%20and%20payloads%20for%20your%20app%E2%80%99s%20URLs!%26nbsp%3BBut%20if%20we%20have%20many%20URLs%20we%20might%20want%20to%20change%20the%20host%20depending%20on%20the%20environment.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId-1031948065%5C%26quot%3B%22%20id%3D%22toc-hId--1455540782%22%20id%3D%22toc-hId--1455540782%22%20id%3D%22toc-hId--1455540782%22%3E%26nbsp%3B%26lt%3B%5C%2FH1%26gt%3B%5Cn%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId--775506398%5C%26quot%3B%22%20id%3D%22toc-hId-1031972051%22%20id%3D%22toc-hId-1031972051%22%20id%3D%22toc-hId-1031972051%22%3EVariables%26lt%3B%5C%2FH1%26gt%3B%5Cn%3CP%3EYou%20can%20add%20variables%20in%20the%20same%20%3CEM%3E%3CSTRONG%3Eclient.rest%26lt%3B%5C%2FSTRONG%26gt%3B%26lt%3B%5C%2FEM%26gt%3B%20file%20using%20the%20syntax%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%40%3CVARIABLE%20name%3D%22%22%3E%20%3D%20%3CVARIABLE%20value%3D%22%22%3E%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FVARIABLE%3E%3C%2FVARIABLE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EThen%20you%20can%20place%20the%20variable%20by%20using%20%7B%7Bvariable%20name%7D%7D%20anywhere%20in%20the%20rest%20of%20the%20file.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EIf%20you%20want%20the%20variable%20to%20refer%20to%20a%20specific%20request%20simply%20put%20the%20variable%20declaration%20inside%20the%20%3CSTRONG%3E%23%23%23%26lt%3B%5C%2FSTRONG%26gt%3B.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EYou%20can%20also%20store%20variables%20at%20the%20%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fgithub.com%2FHuachao%2Fvscode-restclient%23environment-variables%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3Eenvironment%20level%26lt%3B%5C%2FA%26gt%3B%20(esp.%20useful%20if%20you%20want%20to%20avoid%20checking%20in%20secrets%20to%20source%20control).%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-applescript%3D%22%22%3E%3CCODE%3E%40host%3Dmicrosoft.com%5Cn%5Cn%23%23%23%20Get%20Base%5Cn%5CnGET%20https%3A%2F%2F%7B%7Bhost%7D%7D%5Cn%5Cn%23%23%23%20Post%20Base%5Cn%5Cn%40patientid%3D1234%5Cn%5CnPOST%20https%3A%2F%2Flocalhost%3A5001%2Fapi%2FPatient%2F%5Cn%5CnContent-type%3A%20application%2Fjson%5Cn%5Cn%7B%5Cn%5Cn%20%20%20Id%3A%7B%7Bpatientid%7D%7D%5Cn%5Cn%7D%5Cn%5Cn%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%5Cn%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId-1712006435%5C%26quot%3B%22%20id%3D%22toc-hId--775482412%22%20id%3D%22toc-hId--775482412%22%20id%3D%22toc-hId--775482412%22%3EFHIR%20Sample%26lt%3B%5C%2FH1%26gt%3B%5Cn%3CP%3EThis%20is%20great%20for%20development%20but%20it%20makes%20developing%20against%20FHIR%20endpoints%20incredibly%20easy.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3ETake%20a%20look%20at%20this%20example%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-applescript%3D%22%22%3E%3CCODE%3E%23%23%23%20Get%20single%20patient%5Cn%5Cn%40patientid%3Df5e7ee94-bfc6-465e-a64d-f0c90e3d50f5%5Cn%5CnGET%20https%3A%2F%2F%7B%7Bfhirname%7D%7D.azurehealthcareapis.com%2FPatient%2F%7B%7Bpatientid%7D%7D%5Cn%5CnAuthorization%3A%20Bearer%20%7B%7Bauth.response.body.access_token%7D%7D%5Cn%5Cn%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%5Cn%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EThis%20gets%20a%20single%20patient%20resource.%20Why%20is%20this%20better%20than%20a%20Postman%20collection%3F%20You%20can%20easily%20check%20it%20into%20source%2C%20you%20can%20easily%20edit%20it%20without%20having%20to%20click%20around%20the%20Postman%20GUI%2C%20and%20most%20importantly-%20you%20can%20quickly%20copy%20paste%20the%20request%20or%20response%20since%20it%E2%80%99s%20all%20text.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EPlease%20see%20the%20%3CA%20href%3D%22%5C%26quot%3Bhttps%3A%2F%2Fgithub.com%2Fmicrosoft%2FOpenHack-FHIR%5C%26quot%3B%22%20target%3D%22%5C%26quot%3B_blank%5C%26quot%3B%22%20rel%3D%22%5C%26quot%3Bnoopener%20nofollow%20noopener%20noreferrer%22%20noreferrer%3D%22%22%3Eexample%20client.rest%26lt%3B%5C%2FA%26gt%3B%20included%20in%20the%20Open%20Hack%20for%20FHIR.%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FA%3E%3C%2FP%3E%3CP%3EThis%20example%20includes%20queries%20for%20getting%20a%20token%2C%20fetching%20a%20patient%2C%20and%20fetching%20a%20list%20of%20patients!%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId--95448028%5C%26quot%3B%22%20id%3D%22toc-hId-1712030421%22%20id%3D%22toc-hId-1712030421%22%20id%3D%22toc-hId-1712030421%22%3E%26nbsp%3B%26lt%3B%5C%2FH1%26gt%3B%5Cn%3C%2FH1%3E%3CH1%20id%3D%22%5C%26quot%3Btoc-hId--1902902491%5C%26quot%3B%22%20id%3D%22toc-hId--95424042%22%20id%3D%22toc-hId--95424042%22%20id%3D%22toc-hId--95424042%22%3EBenefits%26lt%3B%5C%2FH1%26gt%3B%5Cn%3CP%3EUsing%20the%20REST%20Client%20has%20many%20benefits.%20But%20chief%20among%20them%20is%20speed.%20If%20you%20use%20an%20external%20tool%2C%20you%E2%80%99ll%20have%20to%20alt-tab%20to%20it%20while%20you%20develop.%20You%E2%80%99ll%20have%20to%20be%20trained%2C%20and%20train%20others%20on%20it.%20With%20REST%20Client-%20you%20only%20need%20to%20know%20how%20to%20use%20the%20same%20IDE%20you%20already%20know%20and%20love!%26lt%3B%5C%2FP%26gt%3B%5Cn%3CUL%3E%5Cn%3CLI%3EStay%20in%20the%20IDE%20%E2%80%93%20stop%20the%20context%20switching.%20Dev%20and%20test%20from%20the%20same%20place.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3EDocument%20All%20URLs%20your%20app%20uses%26nbsp%3B%20-%20No%20more%20bookmarks%20or%20comments%20in%20code-%20just%20document%20the%20URLs%20as%20you%20dev%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3EStore%20URLs%20next%20to%20your%20code%20%E2%80%93%20Since%20everything%20is%20in%20simple%20plain%20text%20files%2C%20as%20you%20change%20and%20modify%20your%20.rest%20files%20you%E2%80%99ll%20be%20able%20to%20easily%20track%20the%20differences.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3EQuickly%20Test%20URLs%20%E2%80%93%20a%20year%20after%20you%20stop%20working%20on%20a%20project-%20you%20simply%20open%20the%20text%20file%20and%20hit%20%E2%80%9Csend%20request%E2%80%9D%20to%20send%20a%20request.%20No%20more%20importing%20and%20setting%20up%20an%20environment.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3EInspect%20Responses%20As%20Text%20Files%20%E2%80%93%20use%20all%20the%20tools%20of%20VS%20Code%20%26nbsp%3Bto%20look%20through%20the%20response%3A%20collapse%2Fexpand%2C%20find%2C%20regex.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3ESave%2FShare%20Responses%20%E2%80%93%20No%20more%20screenshots%20of%20browser%20dev%20tools-%20simply%20send%20others%20the%20entire%20response%20payload.%26lt%3B%5C%2FLI%26gt%3B%5Cn%3C%2FLI%3E%3CLI%3ECode%20Spaces%20Compliant%26lt%3B%5C%2FLI%26gt%3B%5Cn%26lt%3B%5C%2FUL%26gt%3B%5Cn%3CP%3EPostman%20still%20has%20features%20that%20you%20won%E2%80%99t%20find%20anywhere%20else%2C%20but%20for%20most%20day-to-day%20app%20dev%20use%20cases%20you%E2%80%99ll%20%26nbsp%3Bfind%20REST%20client%20extension%20in%20Visual%20Studio%20Code%20meets%20your%20needs.%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-TEASER%20id%3D%22%5C%26quot%3Blingo-teaser-3145949%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3C%2FLINGO-TEASER%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346879iA961EA49A2761F2C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%22SameerDoshi_0-1644444691354.png%22%20alt%3D%22%5C%26quot%3BSameerDoshi_0-1644444691354.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%5Cn%3C%2FP%3E%3CP%3EDevelopers%20use%20a%20lot%20of%20URLs%3A%20your%20app%E2%80%99s%20URLs%2C%20URLs%20for%20consumed%20services%2C%20etc.%20These%20URLs%2C%20and%20sometimes%20their%20payloads%20may%20differ%20per%20environment.%20And%20as%20a%20dev%20you%E2%80%99re%20going%20to%20constantly%20hit%20them.%20Developers%20have%20relied%20on%20utilities%20outside%20the%20IDE%20to%20track%20the%20URLs%2C%20send%20test%20payloads%20to%20the%20URLs%2C%20and%20inspect%20the%20%26nbsp%3Bresponse.%20Now%20you%20can%20do%20all%20of%20that%20from%20your%20IDE!%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-teaser%26gt%3B%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FH1%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FH1%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3145949%22%20slang%3D%22en-US%22%3ECalling%20REST%20APIs%20From%20the%20IDE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3145949%22%20slang%3D%22en-US%22%3E%3CP%3EDevelopers%20use%20a%20lot%20of%20URLs%3A%20your%20app%E2%80%99s%20URLs%2C%20URLs%20for%20consumed%20services%2C%20etc.%20These%20URLs%2C%20and%20sometimes%20their%20payloads%20may%20differ%20per%20environment.%20And%20as%20a%20dev%20you%E2%80%99re%20going%20to%20constantly%20hit%20them.%20Developers%20have%20relied%20on%20utilities%20outside%20the%20IDE%20to%20track%20the%20URLs%2C%20send%20test%20payloads%20to%20the%20URLs%2C%20and%20inspect%20the%20%26nbsp%3Bresponse.%20Now%20you%20can%20do%20all%20of%20that%20from%20your%20IDE!%20To%20do%20this%20we%E2%80%99ll%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EREST%20Client%3C%2FA%3E%20extension%20for%20%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%2FDownload%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EVisual%20Studio%20Code%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--2135623138%22%20id%3D%22toc-hId--1902878505%22%3EGet%20Started%3C%2FH1%3E%0A%3CUL%3E%0A%3CLI%3EClick%20%3CA%20href%3D%22https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%20to%20Install%20the%20extension.%3C%2FLI%3E%0A%3CLI%3EMake%20our%20first%20call.%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20new%20file%20called%20%3CEM%3E%3CSTRONG%3Eclient.rest%3C%2FSTRONG%3E%3C%2FEM%3E%20with%20this%20content%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%23%23%23%20First%20Test%0AGET%20http%3A%2F%2Fmicrosoft.com%20HTTP%2F1.1%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20soon%20as%20you%20save%2C%20you%E2%80%99ll%20see%20a%20Send%20Request%20button%20appear%20right%20after%20the%20%3CSTRONG%3E%23%23%23.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SameerDoshi_1-1644444713008.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346880i7C841DAF70C1FCD2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SameerDoshi_1-1644444713008.png%22%20alt%3D%22SameerDoshi_1-1644444713008.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20%3CEM%3E%3CSTRONG%3Esend%20request%26nbsp%3B%3C%2FSTRONG%3E%3C%2FEM%3Eand%20you%E2%80%99ll%20see%20the%20response%20right%20in%20the%20IDE.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SameerDoshi_2-1644444713015.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346881iFECE10572EF30EF3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SameerDoshi_2-1644444713015.png%22%20alt%3D%22SameerDoshi_2-1644444713015.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%E2%80%99s%20it!%20No%20need%20to%20open%20a%20web%20browser%2C%20debug%20tools%2C%20networking%2C%20and%20then%20inspect%20responses-%20it%E2%80%99s%20all%20right%20there!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20share%20the%20response%20-%20you%20can%20save%2C%20copy%2Fpaste%2C%20or%20explore%20the%20response%20at%20your%20leisure!%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWant%20to%20share%20everything%20you%E2%80%99ve%20done%20so%20far%3F%20Simply%20add%20the%20%3CEM%3E%3CSTRONG%3Eclient.rest%3C%2FSTRONG%3E%3C%2FEM%3E%20file%20to%20source%20control%20and%20anyone%20who%20opens%20it%20will%20run%20the%20same%20call%20as%20you%20just%20did.%26nbsp%3BBut%2C%20of%20course%2C%20we%E2%80%99re%20just%20getting%20started!%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-351889695%22%20id%3D%22toc-hId-584634328%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--1455564768%22%20id%3D%22toc-hId--1222820135%22%3EPOST%20Requests%20With%20JSON%20Payload%3C%2FH1%3E%0A%3CP%3EWe%20can%20add%20as%20many%20URLs%20to%20this%20file%2C%20or%20we%20can%20create%20other%20files%20with%20a%20.rest%20extension.%26nbsp%3B%20For%20now%20let%E2%80%99s%20add%20to%20our%20existing%20file.%26nbsp%3B%20Multiple%20calls%20are%20separated%20by%20a%20new%20line%20starting%20with%20%3CSTRONG%3E%23%23%23%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdd%20a%20post%20request%20by%20adding%20a%20%3CSTRONG%3E%23%23%23%3C%2FSTRONG%3E%20to%20the%20bottom%20of%20the%20file..%26nbsp%3B%20Just%20add%26nbsp%3B%3CSTRONG%3E%23%23%23%3C%2FSTRONG%3E%20to%20add%20additional%20requests.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%E2%80%99d%20expect%20you%20can%20use%20%3CEM%3E%3CSTRONG%3E%3CCTRL%3E%2B%20space%3C%2FCTRL%3E%3C%2FSTRONG%3E%3C%2FEM%3E%20to%20autocomplete%20all%20entries.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%23%23%23%0APOST%20https%3A%2F%2Flocalhost%3A5001%2Fapi%2FPatient%20HTTP%201.1%0AContent-Type%3A%20%20application%2Fjson%0A%0A%7B%0A%0A%20%20%20%20%22name%22%3A%22H.%20Simpson%22%0A%0A%7D%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20Send%20Request%20and%20you%E2%80%99ll%20get%20a%20response.%20You%20can%20imagine%20having%20a%20file%20called%20%3CEM%3E%3CSTRONG%3Eservices.rest%3C%2FSTRONG%3E%3C%2FEM%3E%20that%20describes%20the%20payload%20and%20urls%20for%20each%20of%20your%20dependent%20services%2C%20and%20another%20file%20called%20%3CEM%3E%3CSTRONG%3Eapp.rest%3C%2FSTRONG%3E%3C%2FEM%3E%20that%20describes%20the%20URLs%20and%20payloads%20for%20your%20app%E2%80%99s%20URLs!%26nbsp%3BBut%20if%20we%20have%20many%20URLs%20we%20might%20want%20to%20change%20the%20host%20depending%20on%20the%20environment.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1031948065%22%20id%3D%22toc-hId-1012428359%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--775506398%22%20id%3D%22toc-hId--795026104%22%3EVariables%3C%2FH1%3E%0A%3CP%3EYou%20can%20add%20variables%20in%20the%20same%20%3CEM%3E%3CSTRONG%3Eclient.rest%3C%2FSTRONG%3E%3C%2FEM%3E%20file%20using%20the%20syntax%3C%2FP%3E%0A%3CP%3E%40%3CVARIABLE%20name%3D%22%22%3E%20%3D%20%3CVARIABLE%20value%3D%22%22%3E%3C%2FVARIABLE%3E%3C%2FVARIABLE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20you%20can%20place%20the%20variable%20by%20using%20%7B%7Bvariable%20name%7D%7D%20anywhere%20in%20the%20rest%20of%20the%20file.%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20the%20variable%20to%20refer%20to%20a%20specific%20request%20simply%20put%20the%20variable%20declaration%20inside%20the%20%3CSTRONG%3E%23%23%23%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20store%20variables%20at%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FHuachao%2Fvscode-restclient%23environment-variables%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eenvironment%20level%3C%2FA%3E%20(esp.%20useful%20if%20you%20want%20to%20avoid%20checking%20in%20secrets%20to%20source%20control).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%40host%3Dmicrosoft.com%0A%0A%23%23%23%20Get%20Base%0A%0AGET%20https%3A%2F%2F%7B%7Bhost%7D%7D%0A%0A%23%23%23%20Post%20Base%0A%0A%40patientid%3D1234%0A%0APOST%20https%3A%2F%2Flocalhost%3A5001%2Fapi%2FPatient%2F%0A%0AContent-type%3A%20application%2Fjson%0A%0A%7B%0A%0A%20%20%20Id%3A%7B%7Bpatientid%7D%7D%0A%0A%7D%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1712006435%22%20id%3D%22toc-hId-1692486729%22%3EFHIR%20Sample%3C%2FH1%3E%0A%3CP%3EThis%20is%20great%20for%20development%20but%20it%20makes%20developing%20against%20FHIR%20endpoints%20incredibly%20easy.%3C%2FP%3E%0A%3CP%3ETake%20a%20look%20at%20this%20example%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%23%23%23%20Get%20single%20patient%0A%0A%40patientid%3Df5e7ee94-bfc6-465e-a64d-f0c90e3d50f5%0A%0AGET%20https%3A%2F%2F%7B%7Bfhirname%7D%7D.azurehealthcareapis.com%2FPatient%2F%7B%7Bpatientid%7D%7D%0A%0AAuthorization%3A%20Bearer%20%7B%7Bauth.response.body.access_token%7D%7D%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20gets%20a%20single%20patient%20resource.%20Why%20is%20this%20better%20than%20a%20Postman%20collection%3F%20You%20can%20easily%20check%20it%20into%20source%2C%20you%20can%20easily%20edit%20it%20without%20having%20to%20click%20around%20the%20Postman%20GUI%2C%20and%20most%20importantly-%20you%20can%20quickly%20copy%20paste%20the%20request%20or%20response%20since%20it%E2%80%99s%20all%20text.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20see%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FOpenHack-FHIR%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eexample%20client.rest%3C%2FA%3E%20included%20in%20the%20Open%20Hack%20for%20FHIR.%3C%2FP%3E%0A%3CP%3EThis%20example%20includes%20queries%20for%20getting%20a%20token%2C%20fetching%20a%20patient%2C%20and%20fetching%20a%20list%20of%20patients!%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--95448028%22%20id%3D%22toc-hId--114967734%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--1902902491%22%20id%3D%22toc-hId--1922422197%22%3EBenefits%3C%2FH1%3E%0A%3CP%3EUsing%20the%20REST%20Client%20has%20many%20benefits.%20But%20chief%20among%20them%20is%20speed.%20If%20you%20use%20an%20external%20tool%2C%20you%E2%80%99ll%20have%20to%20alt-tab%20to%20it%20while%20you%20develop.%20You%E2%80%99ll%20have%20to%20be%20trained%2C%20and%20train%20others%20on%20it.%20With%20REST%20Client-%20you%20only%20need%20to%20know%20how%20to%20use%20the%20same%20IDE%20you%20already%20know%20and%20love!%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EStay%20in%20the%20IDE%20%E2%80%93%20stop%20the%20context%20switching.%20Dev%20and%20test%20from%20the%20same%20place.%3C%2FLI%3E%0A%3CLI%3EDocument%20All%20URLs%20your%20app%20uses%26nbsp%3B%20-%20No%20more%20bookmarks%20or%20comments%20in%20code-%20just%20document%20the%20URLs%20as%20you%20dev%3C%2FLI%3E%0A%3CLI%3EStore%20URLs%20next%20to%20your%20code%20%E2%80%93%20Since%20everything%20is%20in%20simple%20plain%20text%20files%2C%20as%20you%20change%20and%20modify%20your%20.rest%20files%20you%E2%80%99ll%20be%20able%20to%20easily%20track%20the%20differences.%3C%2FLI%3E%0A%3CLI%3EQuickly%20Test%20URLs%20%E2%80%93%20a%20year%20after%20you%20stop%20working%20on%20a%20project-%20you%20simply%20open%20the%20text%20file%20and%20hit%20%E2%80%9Csend%20request%E2%80%9D%20to%20send%20a%20request.%20No%20more%20importing%20and%20setting%20up%20an%20environment.%3C%2FLI%3E%0A%3CLI%3EInspect%20Responses%20As%20Text%20Files%20%E2%80%93%20use%20all%20the%20tools%20of%20VS%20Code%20%26nbsp%3Bto%20look%20through%20the%20response%3A%20collapse%2Fexpand%2C%20find%2C%20regex.%3C%2FLI%3E%0A%3CLI%3ESave%2FShare%20Responses%20%E2%80%93%20No%20more%20screenshots%20of%20browser%20dev%20tools-%20simply%20send%20others%20the%20entire%20response%20payload.%3C%2FLI%3E%0A%3CLI%3ECode%20Spaces%20Compliant%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EPostman%20still%20has%20features%20that%20you%20won%E2%80%99t%20find%20anywhere%20else%2C%20but%20for%20most%20day-to-day%20app%20dev%20use%20cases%20you%E2%80%99ll%20%26nbsp%3Bfind%20REST%20client%20extension%20in%20Visual%20Studio%20Code%20meets%20your%20needs.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3145949%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SameerDoshi_0-1644444691354.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346879iA961EA49A2761F2C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SameerDoshi_0-1644444691354.png%22%20alt%3D%22SameerDoshi_0-1644444691354.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDevelopers%20use%20a%20lot%20of%20URLs%3A%20your%20app%E2%80%99s%20URLs%2C%20URLs%20for%20consumed%20services%2C%20etc.%20These%20URLs%2C%20and%20sometimes%20their%20payloads%20may%20differ%20per%20environment.%20And%20as%20a%20dev%20you%E2%80%99re%20going%20to%20constantly%20hit%20them.%20Developers%20have%20relied%20on%20utilities%20outside%20the%20IDE%20to%20track%20the%20URLs%2C%20send%20test%20payloads%20to%20the%20URLs%2C%20and%20inspect%20the%20%26nbsp%3Bresponse.%20Now%20you%20can%20do%20all%20of%20that%20from%20your%20IDE!%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Version history
Last update:
‎Feb 09 2022 03:31 PM
Updated by: