We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Live Body

It's finally time to end-to-end test our full HTTP request parsing!

Assignment

Again, we already did the hard parts!

  1. Request line:
    - Method: METHOD
    - Target: TARGET
    - Version: VERSION
    Headers:
    - KEY: VALUE
    - KEY: VALUE
    Body:
    BODY_STRING
    ...
    

    Be sure to stringify the body for printing.

  2. go run ./cmd/tcplistener | tee /tmp/body.txt
    
  3. curl -X POST http://localhost:42069/coffee \
    -H 'Content-Type: application/json' \
    -d '{"type": "dark mode", "size": "medium"}'
    

Run and submit the CLI tests.