Skip to content

Typesafe client: Custom User-Agent #2289

@jmini

Description

@jmini

I would need to solve having a custom agent from Quarkus and outside Quarkus.
--> Inputs are welcomed for both cases.

I looked only at the plain-java (outside quarkus) case for now:

Based on the input in the documentation, I thought I just need custom headers:
https://smallrye.io/smallrye-graphql/latest/typesafe-client-headers/

Like this:

            WorkitemClientApi gqlApi = TypesafeGraphQLClientBuilder.newBuilder()
                    .endpoint("http://localhost:8888/api/graphql")
                    .header("user-agent", "My Custom User Agent")
                    .header("Authorization", "Bearer " + gitlabToken)
                    .allowUnexpectedResponseFields(true)
                    .build(WorkitemClientApi.class);
            return gqlApi;

Request intercepted with mitmproxy:

mitmweb -p 8888 --mode reverse:https://**********/
Image

Metadata

Metadata

Assignees

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