[racket] What is a comparable rkt code for curl command with HTTP Auth?

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sun Jan 8 01:35:18 EST 2012

Two things to do:

1. "base64-encode" produces a newline at the end, which you probably 
want to remove somehow:

#lang racket/base
(require net/base64)

(base64-encode #"user:pwd")
;==> #"dXNlcjpwd2Q=\r\n"

(regexp-replace #rx#"[\r\n]+$" (base64-encode #"user:pwd") "")
;==> #"dXNlcjpwd2Q="

2. Your debugging will be much easier if you can see the actual protocol 
between client and server.  My favorite tool for this is Wireshark, 
which is Free Software.  Then you can compare the protocol of your 
"curl" example with your Racket one.


Posted on the users mailing list.