Skip to content

allow client to set the USER-AGENT to support testing #63

@jbfaden

Description

@jbfaden

It would be nice to set the User-Agent so that HAPI servers can filter requests made for testing from those where it's being used for science.

To set it in Python, it is something like:

USER_AGENT = 'hapibot-a/1.0; https://github.com/hapi-server/data-specification/wiki/hapi-bots.md#hapibot-a'
headers= { "User-Agent" : USER_AGENT }
x = requests.get(cS,headers=headers)

I'd suggest this would be an option in the **opts structure, like so:

agent= 'hapibot-z/1.0; https://github.com/hapi-server/data-specification/wiki/hapi-bots.md#hapibot-z'
opts = {'logging': False, 'format': 'csv', 'usecache': True, 'useragent':agent}
hapidata = hapiclient.hapi(server, dataset, parameters, start, stop, **opts)

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