Skip to content

Ability to get binary response body (e.g., for images) #26

@kinghuang

Description

@kinghuang

Is there a way to get the http_get function to return a binary response body? For example, let's say I want to get a PNG image. Right now, it results in an Invalid Input Error.

D select
    http_get('https://httpbin.org/image', headers => MAP {'accept': 'image/png'}, params => MAP {}) as data
  ;
Invalid Input Error: Invalid unicode (byte sequence mismatch) detected in segment statistics update

The http_get function currently returns a JSON object with the response status, reason, and body as a string. This doesn't work well with non-text response bodies.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions