From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: Questions about the (web client) module. Date: Fri, 21 Jul 2017 01:05:14 -0400 Message-ID: <87bmoecrcl.fsf@netris.org> References: <87o9sfxtuk.fsf@gnu.org> <878tjjru96.fsf@gnu.org> <87h8y691nm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500613563 4080 195.159.176.226 (21 Jul 2017 05:06:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2017 05:06:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-user@gnu.org To: Roel Janssen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jul 21 07:05:57 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYQ8T-0000fY-JG for guile-user@m.gmane.org; Fri, 21 Jul 2017 07:05:57 +0200 Original-Received: from localhost ([::1]:41068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYQ8X-0003CS-J2 for guile-user@m.gmane.org; Fri, 21 Jul 2017 01:06:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYQ82-0003Ai-Fy for guile-user@gnu.org; Fri, 21 Jul 2017 01:05:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYQ7z-0004as-AQ for guile-user@gnu.org; Fri, 21 Jul 2017 01:05:30 -0400 Original-Received: from world.peace.net ([50.252.239.5]:57692) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYQ7z-0004aX-6A; Fri, 21 Jul 2017 01:05:27 -0400 Original-Received: from pool-72-93-34-106.bstnma.east.verizon.net ([72.93.34.106] helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dYQ7x-00074e-Ts; Fri, 21 Jul 2017 01:05:26 -0400 In-Reply-To: <87h8y691nm.fsf@gnu.org> (Roel Janssen's message of "Fri, 21 Jul 2017 00:36:13 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.252.239.5 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13960 Archived-At: Roel Janssen writes: > Here's the entire code I use: > > (define* (sparql-query-post query > #:key > (host "localhost") > (port 8890) > (graph "") > (type "json")) > (let ((base-uri (string-append "http://" host ":" (number->string port) )) > (boundary "guile-virtuoso-driver")) > (let ((body (string-append > (format #f > "--~a~%Content-Disposition: form-data; name=~s~%~%text/csv~%" > boundary "format") > (format #f > "--~a~%Content-Disposition: form-data; name=~s~%~%~a~%--~a~%" > boundary "query" query boundary)))) > (http-post > (string-append base-uri "/sparql") > #:body body > #:headers `((content-length . ,(string-length body)) Another thing: you can omit the 'content-length' header here. It will be added automatically, and in fact the value you use here is incorrect unless the body is ASCII-only, because it's supposed to be the length in bytes, but here you are giving the length in characters. Mark