Skip to content

Allow specifying headers for sys.http builtins #602

Open
@johnrengelman

Description

@johnrengelman

Currently, you cannot specify custom headers using the sys.http builts in (sys.http.get). The only parameter for get is the URL (https://github.com/gptscript-ai/gptscript/blob/main/pkg/builtin/builtin.go#L564), while post allows specifying the content and content-type (https://github.com/gptscript-ai/gptscript/blob/main/pkg/builtin/builtin.go#L607-L610).

Adding support for customer headers would allow tools to use the built-in functions to communicate with API endpoints that require tokens or api keys as headers to be invoked. It would also benefit from being able to customize things such as User-Agent headers or trace ids for requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestproposalAn enhancement or documentation proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions