[racket] question about client side http post

From: J G Cho (gcho at fundingmatters.com)
Date: Mon Jan 2 17:03:20 EST 2012

I am trying to do client side HTTP POST using

(require net/url)

(post-pure-port URL post [header]) → input-port?
  URL : url?
  post : bytes?
  header : (listof string?) = null

The following throws no exception but does not seem to do the intended
job (I used Chrome to test the remote URL's get and post. So I am sure
it works on the server side).

(require net/url)

(define (save-remote! data)
  (define URL  (string->url "https://example.com/some-method?"))
  (define DATA (string->bytes/utf-8  (format "key=~a" data)))

  (port-string (post-pure-port URL DATA)))

What am I doing wrong here?

jGc



Posted on the users mailing list.