Skip to content

HTTP-header stuff inside of HTTP-body when retrieving JSON data #25

@axettone

Description

@axettone

I was testing the pengine/create interface using cURL and I noticed that the raw response in composed by multiple JSON items interleaved by this:

Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Content-type: application/json; charset=UTF-8

Isn't that an HTTP response header? So.. why is it in the body? The problem is that it breaks JSON parsing.

How to replicate (from bash):

$ curl -s -d format=json -d "template=prolog(A)" -d "ask=actor(_, A, ), director(, A)" -d solutions=all -d "src_text=:-include('movies.pl')." -d application=swish -d chunk=10 http://swish.swi-prolog.org/pengine/create

Temporary fix: using -d chunk=1000000 without solutions=all

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions