index.http¶
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Server: netcat!
<!doctype html>
<html><body><h1>A webpage served by netcat</h1></body></html>
client¶
#!/bin/bash
# Send a message to the server running on this machine using curl.
curl -X POST --data "Hello, server!" localhost:8080
server¶
#!/bin/bash
cat index.http | nc -l 8080
curl_jsonplaceholder¶
#!/bin/bash
curl -X POST \
--url https://jsonplaceholder.typicode.com/posts \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"title": "Welcome!", "body": "Hello and welcome to the blog!"}'