FAQ: Requests II - async POST Requests II

This community-built FAQ covers the “async POST Requests II” 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 II

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!

When I get to step 5 of the async Post Requests II lesson the closing curly brace of my async getData arrow function turned red/pink. I can’t figure out why. Am I missing a semicolon? I tried adding where I thought they might go, but I can’t make the curly brace go back to white.

and here’s the code:

const getData = async () => {
  try {
    const response = await fetch('https://api-to-call.com/endpoint', {
        method: 'POST',
        body: JSON.stringify({id: 200})
      }
    );
  } catch(error) {
    console.log(error);
  }
};

Mine has done the same thing throughout these exercises. I’m unsure of the reason why but it hasn’t stopped me progressing or stopped my code from working so I’ve just ignored it.

1 Like

it seems you have an extra parenthesis and semi-colon after your try code block

same as @robgit28 : I copy-pasted your code @rainbowzebra in the editor of my lesson and there is no red curly brace, so your code is fine.