Networking with URLSession - Part 2: HTTP 101 | Ray Wenderlich

Learn some HTTP basics to make the most of URLSession, and discover the easy way to create URL objects from Strings.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3986-networking-with-urlsession/lessons/2

I’m trying to work through the URLSessions coursework, but I’ve found it rather difficult to follow along as there isn’t much in the way of explaining how to insert the data into the terminal. I’m rather new to using terminal, so most of the queries I’ve used are executed simply with hitting “enter”. However, for creating the db.json file and copy-pasting the example code, this doesn’t work, which leaves me stuck while the video continues on.

To create a text file, you can use a Unix text editor: see https://earthsci.stanford.edu/computing/unix/editing/editorchoices.php

I use vi but pico might be easier. Or you can use the Mac text edit app, but make sure it’s set tto plain text, not rich text: you should not see any formatting tool bar or ruler.

The terminal app uses Unix commands. Google unix tutorial to find resources.

Also, the video editors speed up the typing in the demos — almost no one will be able to keep up, so just pause the video when necessary.

I ran into the same issue. After you install JSON Server, type “json-server db.json” to create the .json example file with some default data.

It should store the file in your Home directory (Macintosh HD → Users → YourUserName).

You should then be able to continue along with the instructor.

1 Like

I think the cookies demo section has to be updated, the new url is https://www.aboutcookies.org but it doesnt seem to set a cookie anymore. :frowning:

1 Like

thanks Roberto! it seems there’s an error in their “cookie solution” code, and it prevents cookie-setting.

Hey Audrey. I like your way to explain. Further, as a non-native english speaker, I can understand your clean speech very good :slight_smile:
Regards

thanks Thilo — I love compliments :wink:

do you know about the subtitles? button in the lower right corner, next to the full-screen button