FAQ: Requests II - async POST Requests III

This community-built FAQ covers the “async POST Requests III” exercise from the lesson “Requests II”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction To JavaScript

FAQs on the exercise async POST Requests III

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

There is an issue with Rebrandly API. I am getting the error that:

Failed to load resource: the server responded with a status of 401 (Unauthorized)

Hi guys,

Throughout this GET and POST requests lesson I have trouble understanding how one part fit into the other.

In every POST and GET lesson in this chapter we start with writing code similar to this:

const getData = async () => {
try {
const response = await fetch(‘https://api-to-call.com/endpoint’, {
method: ‘POST’,
body: JSON.stringify({id: 200})
if (response.ok) {
const jsonResponse = await response.json();
return jsonResponse;
throw new Error(‘Request failed!’);

catch(error) {

Then in the next step it says something like “Since you’ve created a boilerplate code for a POST request…”

I don’t understand how the first step ties into the second step with API keys etc. My getData function is nowhere to be seen in this second step. Can someone please explain their correlation?

1 Like

In this lesson the const shortenUrl = async () => { replaces the getData = async () => { in the boilerplate code.