← Back to team overview

launchpad-dev team mailing list archive

REST calls on local api.launchpad.dev

 

Hello,

I have set up Launchpad on my local machine and can browse the site at
launchpad.dev.

I am now trying to communicate with the local Launchpad over REST. I'm
using curl to test this functionality. Here's an example of a correct
response from edge.launchpad.net:

---
$ curl -i -k -H "Accept: application/json; Content-type:
application/x-www-form-urlencoded" -X POST -d
"oauth_consumer_key=just+testing&oauth_token=&oauth_signature_method=PLAINTEXT&oauth_signature=%26"
https://edge.launchpad.net/+request-token

HTTP/1.1 200 Ok
Date: Thu, 27 May 2010 12:07:39 GMT
Server: zope.server.http (HTTP)
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
X-Content-Type-Warning: guessed from content
Content-Type: text/plain;charset=utf-8
Content-Length: 132
Vary: Cookie,Authorization,Accept-Encoding
Via: 1.1 edge.launchpad.net

oauth_token=mpsk00F70S8pqtjkPWvF&oauth_token_secret=CGlv5DxhH72zKJmj3NPVmbHcFRWTxmsfl6pWH2DnlKBfR90j3Fkr3LM2NJszp4VsMhWdP490TFHJ4gbZ
---

However, when I try the same command with api.launchpad.dev instead of
edge.launchpad.net, I get the following error:

---
$ curl -i -k -H "Accept: application/json; Content-type:
application/x-www-form-urlencoded" -X POST -d
"oauth_consumer_key=just+testing&oauth_token=&oauth_signature_method=PLAINTEXT&oauth_signature=%26"
https://api.launchpad.dev/+request-token

HTTP/1.1 404 Not Found
Date: Thu, 27 May 2010 12:08:11 GMT
Server: zope.server.http (DebugLayerHTTP)
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
X-Lazr-Oopsid: OOPS-1608X3
Content-Type: text/plain
Content-Length: 812
Via: 1.1 launchpad.dev
Vary: Accept-Encoding

Object: <canonical.launchpad.webapp.servers.WebServiceClientRequest
instance URL=https://api.launchpad.dev>, name: ''

Traceback (most recent call last):
  File
"/home/inspirated/launchpad/lp-sourcedeps/eggs/zope.publisher-3.10.0-py2.5.egg/zope/publisher/publish.py",
line 131, in publish
    obj = request.traverse(obj)
  File
"/home/inspirated/launchpad/lp-sourcedeps/eggs/lazr.restful-0.9.26-py2.5.egg/lazr/restful/publisher.py",
line 218, in traverse
    self._removeVirtualHostTraversals()
  File
"/home/inspirated/launchpad/lp-sourcedeps/eggs/lazr.restful-0.9.26-py2.5.egg/lazr/restful/publisher.py",
line 256, in _removeVirtualHostTraversals
    raise NotFound(self, '', self)
NotFound: Object:
<canonical.launchpad.webapp.servers.WebServiceClientRequest instance
URL=https://api.launchpad.dev>, name: ''
---

Can anyone point out what do I need to do to REST with the local Launchpad?

Regards,
-- 
Kamran Riaz Khan.

http://inspirated.com/




Follow ups