CHIPS 3.3: HTTP and URIs
A short, hands-on exploration of the protocol that all SaaS runs on: HTTP.
Gradescope online assignment β no code to turn in
This CHIPS is submitted as a Gradescope online assignment: you answer the questions directly on Gradescope. You do not need to turn in any code. You may still want a private copy of the starter repo,
saasbook/hw-http-intro, to work from (see Getting the Code) β the full walkthrough and setup instructions (local, Docker, or GitHub Codespaces) are in itsREADME.md.
Goals
- Use the command-line tools
curl(as a SaaS client) andnc(netcat, as a stand-in SaaS server) to experiment with HTTP. - Understand how HTTP requests and responses are constructed, including methods, headers, status codes, and request bodies from HTML forms.
- Understand the most common HTTP status codes and what they mean.
- Understand how cookies let a stateless protocol keep track of a βsessionβ.
What youβll do
Work through the guided exercises in the starter repoβs README.md: issue
HTTP requests against real web services and against your own fake server,
observe what comes back at the protocol level, and answer the comprehension
questions on Gradescope as you go β the foundation for understanding REST in
the rest of the course.
Before you start
Watch Module 3 Β§3.1β3.2 and read the matching
textbook sections. You need a shell where curl and nc are available; the
starter repoβs README.md lists the supported ways to get one.
Logistics
- Getting the code: nothing to submit, but see Getting the Code below if you want your own private copy of the starter repo to work from.
- Submission: answer the questions on Gradescope (an online assignment, not a code upload) β see Submission. You may edit your answers as many times as you like before the deadline.
- Extensions: everyone automatically gets a 2-day no-penalty extension; see the extension policy.
- Collaboration: you may collaborate with your team of 4, and discuss high-level approaches with anyone. Sharing answers outside your team is academic misconduct. See the AI Use Policy below before using AI tools.
AI Use Policy
This assignment follows the course AI Policy, which will be published on this site before it is needed. Until then, the rule from the Syllabus applies: you must be able to explain everything you submit.
Getting the Code
Public starter repo: saasbook/hw-http-intro —
https://github.com/saasbook/hw-http-intro
GitHub makes it challenging to have a private fork of a public repository. These steps allow you to create a private space for you own work but still update from the starter code.
Clone the starter repo, then use gh
(see Local Development)
to create a private copy under your own GitHub account and
push the code to it. Replace YOUR_GITHUB_USERNAME with your
GitHub username:
git clone https://github.com/saasbook/hw-http-intro.git
cd hw-http-intro
git remote rename origin upstream
gh repo create YOUR_GITHUB_USERNAME/hw-http-intro --private --source=. --remote=origin --push
git remote set-url --push upstream DISABLED
After this, origin is your private repo and upstream
is the public starter repo. The last command disables pushing to
upstream, so git push always goes to your own
copy β never to the public starter repo.
Keeping your repo up to date
Your private repo is a snapshot: it does not follow the starter
repo. If we fix or add something in saasbook/hw-http-intro
after you copy it, you have to pull those changes in yourself. The
upstream remote you set up above is how you do that:
git fetch upstream
git fetch only downloads β it changes nothing in your working
copy. Review what you are about to take before merging it:
git diff --name-only HEAD upstream/main # just the names of the files that differ
git diff --stat HEAD upstream/main # the same list, plus how much changed in each
git diff HEAD upstream/main -- spec # the actual changes, limited to one file or directoryThen merge the upstream changes into your branch and push them to your private repo:
git merge upstream/main
git push origin main
If you and we edited the same lines, git stops and reports a conflict: open
each file it lists, keep the correct combination of both sides, delete the
<<<<<<< / ======= /
>>>>>>> markers, then git add
those files and git commit. Ask on Ed if a merge leaves you
stuck β don't start over and lose your work.
These commands assume the starter repo's default branch is main.
If git branch -r shows upstream/master instead, use
that name in the commands above.
View this assignment on bCourses.