Skip to content

Headers Fail to Get Set When Processing Http:body  #51

@ajbufort

Description

@ajbufort

Cannot invoke "org.expath.httpclient.HeaderSet.getFirstHeader(String)" because "headers" is null

...is returned by oXygen 26.1 when processing the following XSL...

                <http:request method="post" default-charset="utf-8">
                    <http:header name="Accept" value="*/*;charset=utf-8"/>
                    <http:header name="Accept-Encoding" value="utf-8"/>
                    <http:header name="Authorization" value="Bearer {$api-key}"/>
                    <http:header name="Content-Type" value="application/json;utf-8"/>
                    
                    <http:body media-type="application/json">
                        {
                        "model": "gpt-3.5-turbo-16k",
                        "messages": [
                        {
                        "role": "system",
                        "content": "You are a helpful assistant."
                        },
                        {
                        "role": "user",
                        "content": "Hello!"
                        }
                        ]
                        }
                    </http:body>
                </http:request>

This run is using Saxon-EE 12.3 and http-client-saxon-1.5.1-uber.jar.

Elimination of http:body results in a working, but uselsss, run. So body provokes headers getting set, but it seems that they can't be set because the default variable to which they need to be added isn't an empty array but rather a null.

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