Skip to content
This repository was archived by the owner on Aug 4, 2020. It is now read-only.
This repository was archived by the owner on Aug 4, 2020. It is now read-only.

KeyError: 'User-Agent' #37

@chrismyers81

Description

@chrismyers81

Hi all,

When I try to connect to xively using Python, I get a KeyError; not sure what I'm doing wrong or what that means? :/ I'm running Python 2.7.3 on my new BeagleBone Black rev. C.

The code I'm trying to use to connect, following the rPI documentation (https://xively.com/dev/tutorials/pi/):

!/usr/bin/python

import datetime
import requests
import xively
FEED_ID = 'my_id'
API_KEY = 'my_key'
api = xively.XivelyAPIClient(API_KEY)

Traceback (most recent call last):
File "datalogger.xively", line 14, in
api = xively.XivelyAPIClient(API_KEY)
File "/usr/local/lib/python2.7/dist-packages/xively/api.py", line 45, in init
self.client = self.client_class(key, use_ssl=use_ssl, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/xively/client.py", line 64, in init
xively.version, self.headers['User-Agent'])
KeyError: 'User-Agent'

How can I get around this?

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