Skip to content

AbstractGoogleClient warns about application name not being set #1062

Closed

Description

@meltsufin

I'm hitting this problem by using SQLAdmin with the builder, without setting application name by calling SQLAdmin.Builder(...).setApplicationName("app-name"), you'll see a warning coming from AbstractGoogleClient saying:

"Application name is not set. Call Builder#setApplicationName."

What's the purpose of setting application name? I don't see it being documented. If it's not needed, the warning should be removed.

Activity

  1. NicolaSpreafico commented on Aug 24, 2017

    @NicolaSpreafico

    The purpose of setting the application name can be understood by the javadoc
    https://google.github.io/google-api-java-client/releases/1.21.0/javadoc/com/google/api/client/googleapis/services/AbstractGoogleClient.Builder.html#setApplicationName(java.lang.String)

    Sets the application name to be used in the UserAgent header of each request or null for none.

    This is an UserAgent header example which is received when you use the API
    userAgent: "{application name} Google-API-Java-Client Google-HTTP-Java-Client/1.22.0 (gzip)"

  2. meltsufin commented on Aug 24, 2017

    @meltsufin
    ContributorAuthor

    Thanks @NicolaSpreafico for the pointer. The javadoc still doesn't explain why it's important to set it. It might be used for metrics, but as an API user, how does it affect me?
    @garrettjonesgoogle PTAL

  3. mattwhisenhunt commented on Oct 19, 2017

    @mattwhisenhunt
    Contributor

    This doesn't really affect you. In general API providers use that header to do all sorts of things and it is not uncommon for it to be required by REST APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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