Skip to content

Interacting with RTC using OSLC, Python, and requests lib

30/08/2012
I recently needed to store all comments from a list of all work items from a project I was hosting on jazz.net/hub the predecessor of hub.jazz.net and always wanted to write something similarly to git to interact with jazz (started working on it on github (project link)).

I first tried to emulate the interaction as shown on their github integrator which is overly complicated then I stumbled across a library by Kenneth Reitz for doing http requests.
Using that lib the whole authentication and interactions becomes very easy:

Have fun.

4 Comments leave one →
  1. Javie permalink
    31/07/2014 12:31

    I tried this, but some reason this didn’t work. What I ended up doing was sessions.

    s = requests.Session()
    s.post(host + ‘/j_security_check’, allow_redirects=True, verify=False, data={‘j_username’:user,’j_password’:pw})
    r = s.get(resource_uri, allow_redirects=True, verify=False)

    r.json

  2. 31/07/2014 12:32

    I tried this, but some reason this didn’t work. What I ended up doing was sessions.

    s = requests.Session()
    s.post(host + ‘/j_security_check’, allow_redirects=True, verify=False, data={‘j_username’:user,’j_password’:pw})
    r = s.get(resource_uri, allow_redirects=True, verify=False)

    r.json

    • 31/07/2014 12:36

      thanks for the comment, I guess the post is rather old and things might have changed in the meantime

Trackbacks

  1. Using Python to Build a Jazz Widget – Part 1 | Dan Toczala's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: