chicken-users
[Top][All Lists]
Advanced

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

Re: Bad request error when using uri-common


From: Peter Bex
Subject: Re: Bad request error when using uri-common
Date: Sun, 20 Sep 2020 19:03:32 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

On Sun, Sep 20, 2020 at 04:16:55PM +0000, Brian Hughes wrote:
> This first fragment throws an error:
> 
> (form-urlencoded-separator "&")
> (define foo (make-uri scheme: 'https
>                       host: "graph.facebook.com"
>                       path: `(,my-facebook-id)
>                       query: `[(fields . "name")
>                                (access_token . ,(get-app-access-
> token))]))

Hi Brian,

The path in the snippet above is not an absolute path.

> (display (with-input-from-request foo #f read-json))
> 
> Output:
> $ csi -s fb.scm 
> 
> Error: (call-with-input-request) Client error: 400 Bad Request: "
> https://graph.facebook.com100055065685451?fields=name&access_token=<redacted
> >"

Note the missing slash between .com and 100055...

You can fix this by using path: `(/ ,my-facebook-id)

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

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