foundersandcoders / api-workshop Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
@vlbee and I mentored FAC14 and we think it would be good to have some introductory slides on what an API is in general, what it is used for etc. OR having an additional paragraph on the README which introduces the topic - before the workshop on the request and response pattern.
Where shall we store the questions and make them accessible to Nazareth people?
the method pars is written with out an 'e'
https://github.com/foundersandcoders/api-workshop/blob/master/03-xmlhttprequest.md
...which you can then use to query a server or file of your choice.
url: The requested URL (in this case a local file path: "xmlhttp_info.txt") - in many cases this will be the URL of the server you are querying.
XHR cannot be used to query local files, since the JS runtime is sandboxed by the browser. XHR will only accept URLs. If you do something like xhr.open('GET', 'foo.txt')
, it will be interpreted as http://<ORIGIN>/foo.txt
And store unbroken code in a file called 'solution'
Hi @lucymonie!
Here are my suggestions for questions:
This is just my first thoughts.
From here:
"[JSON] is a way to store information that's organised and easy to access"
The purpose of JSON is for passing structured data between clients and servers. JSON is a file format that can be (1) parsed into a data-structure in a language (e.g. JS) and (2) be safely serialised into a string so that it can be used in HTTP (or other plain-text protocols).
"[JSON] looks like a JavaScript object but its keys and values are always strings"
String, number, boolean, object, array and null are the valid datatypes of the JSON specification.
fix typo in the "asynchronous.md" file name
The extra "request" seems a bit redundant as the 'R' in "XHR" already stands for "request". Probably just me being a bit picky but...
@skibinska I think we need a separate readme for http so we can discuss http methods and status codes properly. Are you okay with that?
we had issues in the first week with people not being able to clone using the ssh link:
[email protected]:lucymonie/api-workshop.git
but
https://github.com/lucymonie/api-workshop.git
would work
- Example one: [fix a broken API request](https://github.com/
lucymoniefoundersandcoders /api-workshop/tree/master/api-example)
also
- Example two: [write an XHR from scratch](https://github.com/
skibinskafoundersandcoders /xhr-workshop)
Option 2 (active maintainer) chosen by @lucymonie
Ideally we would use the same format across all repos in foundersandcoders
Active maintainer
--insert name--
--insert github handle-- (so students know who to @ when they want to raise issues and assign PRs)
--insert photo of author-- (because of https://github.com/foundersandcoders/london-programme/issues/223)
I was going to use the photos that FAC has of us from day 1 of the course. But obviously people would be free to update it with any photo of themselves that they wanted
@rebecacalvoquintero and @ameliejyc have been assigned to make the following changes within this workshop for FAC12.
The phrasing here makes it sound as though all HTTP responses are JSON.
While the overwhelming majority of HTTP APIs will have JSON responses, some won't. Further, there's nothing stopping someone from using XHR to make a request to an actual web page (like google.com), where they'll receive HTML, rather than JSON (making JSON.parse
throw an exception).
It's probably enough to make a brief mention of this before continuing with the JSON.parse
stuff.
It was raised in FACN3 that asking the students to fix typos might not be the most efficient way to show how to write a correct API request.
I will make a PR with my suggestion which is removing important parts of the request (as JSON.parse).
heya!
in step 5 of "what to do" the link to the XHR md file is broken
Not a major issue, but on my chrome (and in general I think) its cmd+alt+i not cmd+shift+i
It might be worth suggesting people install the JSONView extension to make the last part more legible.
In https://github.com/lucymonie/api-workshop/blob/master/03-xmlhttprequest.md the example stores the xhr object in a variable called 'myRequest'
I think it is useful to keep it consistent in this first intro, I would suggest using 'var xhr = ...' throughout this (great) tutorial ๐ฎ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.