Git Product home page Git Product logo

api-workshop's People

Contributors

ameliejyc avatar denesnori avatar eliasmalik avatar emilyb7 avatar ghassanmas avatar helenzhou6 avatar jbarget avatar jsms90 avatar lucymonie avatar m4v15 avatar matthewdking avatar skibinska avatar veredrec avatar vlbee avatar zurda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-workshop's Issues

Add intro slides on APIs

@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.

Remove reference to files from section 3

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

Line breaks in quote

in the XMLHttpRequest file, there is a quote from Eloquent Javascript, the formatting of which is a little off, as the lines on the left break due to linebreaks.

screenshot from 2017-11-16 11-55-15

Adding > symbols to the linebreaks would fix this.

Add 3-4 questions to check the understanding of README topics

Hi @lucymonie!

Here are my suggestions for questions:

01. Request and response:

  1. Could you explain the flow of request-response pattern?
  2. What is responseText and what do we use to transform it?
  3. What is HTTP?

02. xmlhttprequest

  1. How to create an XHR Request?
  2. What and why do we check in onreadystatechange function?
  3. How many parameters accept open method? Could you explain what they are?

03. asynchonous

  1. What is the difference between synchonous and asynchonous?
  2. Could you explain the event loop?

This is just my first thoughts.

Making the description of JSON more accurate

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

fix typo in the "asynchronous.md" file name

New readme for http

@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?

add author & maintainer to readme

Option 2 (active maintainer) chosen by @lucymonie

Ideally we would use the same format across all repos in foundersandcoders


Author

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

Proposed changes to API Workshop

@rebecacalvoquintero and @ameliejyc have been assigned to make the following changes within this workshop for FAC12.

  • Add examples to help differentiate between GET/POST methods.
  • include an introduction to AJAX (because it is not introduced).
  • include how XHR requests handle redirect responses.
  • Brief introduction at the beginning of the workshop --> including the useful learning outcomes the students will get from the workshop.
  • Mentors should go through each section with the group at some time intervals.

No mention of content types in section 1

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.

Replace typos with more meaningful mistakes

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).

broken link

heya!
in step 5 of "what to do" the link to the XHR md file is broken

develpor tools on mac

Not a major issue, but on my chrome (and in general I think) its cmd+alt+i not cmd+shift+i

Chrome JSONView extension

It might be worth suggesting people install the JSONView extension to make the last part more legible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.