chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] http-client egg


From: Ian Oversby
Subject: [Chicken-users] http-client egg
Date: Mon, 14 Aug 2006 06:46:37 +0000

Hi,

Some webpages return a 503 forbidden status when they do not recognise
the User-Agent from the HTTP request.  To get around this in my own code,
I've provided a second exported send-request function like this:

(define (http:my-send-request req . more)
 (let* ((in #f)
        (out #f)
        [req (if (string? req)
(http:make-request 'GET req (cons '("Connection" . "close") more))
                 req)]
...)

And then provided a wrapper function in my client code like this:

(define (send-request-wrapper url)
 (http:imo-send-request url
                        '("User-Agent" . "Mozilla/5.0")
'("Content-Type" . "application/x-www-form-urlencoded")))

This seems to work, but is there a better way of doing this?

Cheers,

Ian






reply via email to

[Prev in Thread] Current Thread [Next in Thread]