Welcome to the CHICKEN Scheme pasting service

403 error on this added by LewisCowper on Wed Jan 14 14:48:49 2015

(require-extension http-client)

(use intarweb uri-common)

(let* ((uri (uri-reference "http://swapi.co/api/planets"))
       (req (make-request
             method: 'GET
             uri: uri
             headers: (headers '((user-agent swapi-scheme))))))

  (with-input-from-request req #f read-string))


;If I perform this request via curl or a REST client, it completes successfully with a 200 OK response. Does http-client or intarweb add other headers that I'm unaware of?


(load "testing.scm")
; loading testing.scm ...

Error: (call-with-input-request) Client error: 403 Forbidden: "http://swapi.co/api/planets"

	Call history:

	http-client.scm:166: close-output-port
	http-client.scm:167: connections
	http-client.scm:167: hash-table-delete!
	http-client.scm:122: open-output-string
	http-client.scm:122: ##sys#check-output-port
	http-client.scm:122: uri-common#uri-host
	http-client.scm:122: ##sys#print
	http-client.scm:122: ##sys#write-char-0
	http-client.scm:122: uri-common#uri-port
	http-client.scm:122: ##sys#print
	http-client.scm:122: get-output-string
	http-client.scm:118: uri-common#uri-port
	http-client.scm:118: uri-common#uri-port
	http-client.scm:119: uri-common#uri-host
	http-client.scm:119: uri-common#uri-host
	http-client.scm:617: raise

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What module provides regular expressions support?
Visually impaired? Let me spell it for you (wav file) download WAV