Check out a free preview of the full Networking and Streams course
The "Curl Headers" Lesson is part of the full, Networking and Streams course featured in this preview video. Here's what you'd learn in this lesson:
James demonstrates how to set HTTP headers within a curl request.
Transcript from the "Curl Headers" Lesson
[00:00:00]
>> So another fun thing to try with Curl, is there's a dash capital H that lets you set headers. So if you want to experiment with setting headers, you can. I'll show you an example of what that would look like. So I run the server like before, I can run Curl command and I paste buffer, right?
[00:00:20]
So. Okay, so if we have our Curl command, we can do something like dash H, cool, colon, beans, and that's gonna set our http header called cool and it's gonna set it to the value beans. So that's just a little example, you can play around it if you like.
[00:00:42]
Some servers are really particular about the headers that you send. Some people interpret the HTTP spec very strictly. [LAUGH] I don't tend to do that myself, but.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops