[plt-scheme] A problem with HTTP request and unbound identifier

From: TPJ (tprimke at gmail.com)
Date: Sat Mar 7 03:17:53 EST 2009

Hello.

I'm new to both Scheme and web programming.

I'm trying to find out a way to learn more about http requests, and
here's my code (based on the one found in PLT Web tutorial):

-----------------------

#lang web-server/insta

(require net/url-structs)
(require web-server/http/request-structs)

(define (show-url req)
  (let* ( (r-url (request-url req))
          (sch (url-scheme r-url)) )
    (display sch)
    (newline)))

(define (get-get req)
  (show-url req)
  '(html
    (head (title "Test"))
    (body (p ,(bytes-string/utf8 (request-method req))))))

(define (start req)
  (get-get req))

-----------------------

It was meant to display some information about URL and the "GET" or
"POST" as the HTTP request method on the generated web-page, but it
doesn't work. All I get after using the "Run" button (I use DrScheme)
is the error message:

expand: unbound identifier in module in: request-url

What am I doing wrong?

BTW, before I got this error message, the code:

,(bytes-string/utf8 (request-method req))

was returning "&request;" string. It wasn't something I expected...


Posted on the users mailing list.