Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDaniel Ahn
Front End Web Development Techdegree Student 8,575 PointswikiUrl api link is not working
https://en.wikipedia.org/api/rest_v1/page/summary/ -- this link results in:
{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/not_found","title":"Not found.","method":"get","detail":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /en.wikipedia.org/v1/page/summary/</pre>\n</body>\n</html>\n","uri":"/en.wikipedia.org/v1/page/summary/"}
So all my astronaut entries take the else branch (Results unavailable)...
1 Answer
Lee Vaughn
Treehouse TeacherHi Daniel Ahn!
We can't really talk specifics without being able to see your code but the URL you are linking above is only part of what you need to get data from the API. You will want to add the astronaut name to the end so that what you are searching for is defined.
Michael Kristensen
Full Stack JavaScript Techdegree Graduate 26,251 PointsMichael Kristensen
Full Stack JavaScript Techdegree Graduate 26,251 PointsThe point about the way the link is constructed in the program, is that it takes the names from the AstrosUrl, which is the list of names of people currently in space, and appends it to the WikiUrl link, and takes the article data from that, so any request for the WikiUrl would be rewritten as (wikiUrl + person.name) -https://en.wikipedia.org/api/rest_v1/page/summary/person.name - For example:
and these links contain the information about the astronauts to build the section HTML from.