Open lazyplatypus opened 3 years ago
![Uploading Mi_Amor 112x112.pngâŠ]()
This week, you will be going through steps to set up tools needed to be successful in this camp. If you are already familiar with some, feel free to skip to the end and complete the task to move on.
One more tip: donât forget to save! Rewriting code can be challenging and extremely frustrating, so save yourself the trouble!
Example output:
Hello! The current time is: 17 : 41 : 34 PM
This time we'll try developing locally. Follow the directions in this link to set up and deploy your first Azure Function right in your local machine.
HTTP_ENDPOINT
so we can check your function. Remember to commit the function's code in a file named httptime.js
to the root of the week1
branch!Note: Every time you make a new commit to week1
, we will check your function by making a request.
Week 1 Step 3
Postman, APIs, and requests
:question: What is Postman and why do we need it?
Later, when we begin to code our Azure Function, we are going to need to test it. **How?** Just like our final web app and the first function we will code, we'll be sending requests to the Function's endpoint.You can install Postman from the Chrome Store as a Chrome extension, or sign up here
:question: What is Postman going to do?
1. After this step, we will code an Azure Function that needs testing. 2. We will also later use Postman to **send a POST request** to our Azure Function to test if it works, mimicking what our static website will do. Our HTTP trigger Azure Functions will be an [API](https://www.youtube.com/watch?v=s7wmiS2mSXY) that receives requests and sends back information. To introduce you to sending requests to an API and how Postman works, we'll be **sending a GET request to an API this time.**:exclamation: Getting Started with Postman
1. You can choose to sign up or skip and go directly to the app. 2. Close out all the tabs that pop up until you reach **this screen** ![image](https://user-images.githubusercontent.com/69332964/98034295-c46a9380-1de4-11eb-8f8d-ca508f4e04ef.png):pencil: Task 4: Send a GET request to the Cat Picture API and receive a cat picture with "Bitcamp" written on it in a specified color and text size.
Try it out yourself:
color
(color of the text) andtext
(font size)Stuck? Check here:
1. **Specifying the API Endpoint:** Enter https://cataas.com/cat/cute/says/Bitcamp, which is the API endpoint, into the text box next to GET ![image](https://user-images.githubusercontent.com/69332964/98034882-ad787100-1de5-11eb-83fd-9cb73f78beae.png) 2. **Setting Parameters:** Click on "Params" and enter `color` into Key and the color you want (eg. blue) into Value. Enter `size` into the next Key row and a number (eg. 50) into Value. > **Note on parameters:** > * the `size` parameter refers to the font size of your caption. It has a limit at around 1,200. > * Colors are pretty hit or miss; since the Cat API is on the web, but it generally adheres to HTML color names. Expect values such as "blue, green, yellow" to work. > * The API can take very large words as input for the caption, however only **34** characters can be seen on the picture at one time . 3. **Click `Send` to get your cat picture**
Interested in playing around with the API? Documentation is here.
:camping: To move on, comment your cat picture đ±