Closed
Bug 586707
Opened 14 years ago
Closed 14 years ago
[API] Put the U in CRUD for the Version model
Categories
(addons.mozilla.org Graveyard :: API, defect, P1)
addons.mozilla.org Graveyard
API
Tracking
(Not tracked)
RESOLVED
FIXED
5.12.1
People
(Reporter: clouserw, Assigned: davedash)
References
Details
(Whiteboard: [devtools][Q32010][qa-])
Weak Spec: https://wiki.mozilla.org/User:Clouserw/AMO/API
Piston Docs: http://bitbucket.org/jespern/django-piston/wiki/Documentation#piston-documentation
This is for the /api/addon/:id/versions/:id fields. This should use the JSONEmitter and accept at least JSON as input. This should use our OAUTH setup for authentication.
Reporter | ||
Updated•14 years ago
|
Target Milestone: 5.11.9 → 5.12
Reporter | ||
Updated•14 years ago
|
Assignee: nobody → dd
Reporter | ||
Updated•14 years ago
|
Target Milestone: 5.12 → 5.12.1
Assignee | ||
Comment 1•14 years ago
|
||
So I tried to PUT with a file, but apparently that doesn't work... it puts the file in the query string, I think...
So this will just involve the meta data (license, release notes).
We should make another call for addon/:id/versions/:id/file/:id and do file CRUD (for 5.12.2 or .3).
CCing Les, in case he understands PUT better than I do. It's by far the hardest to understand of the methods.
Comment 2•14 years ago
|
||
(In reply to comment #1)
> So I tried to PUT with a file, but apparently that doesn't work... it puts the
> file in the query string, I think...
I thought PUT should have a body like POST.
Assignee | ||
Comment 3•14 years ago
|
||
I did too, and the examples I see indicate that it does. But when I do a client.put('http://api/en-US/firefox/api/2/addon/11795/version/68851?oauth_nonce=90563227&oauth_timestamp=1285951575&oauth_consumer_key=ubgbezSEgE589cAJfa&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=s8BtU5wqhrmJASTgT3&oauth_signature=nkv4ACf6HF8u6g2O7gQZbYgdqj0%3D', data=data)
I get the following:
'QUERY_STRING': 'xpi=%3Copen+file+%27%2FUsers%2Fdash%2FProjects%2Fzamboni%2Fzamboni%2Fapps%2Fapi%2Ffixtures%2Fapi%2Fhelloworld-0.2.xpi%27%2C+mode+%27r%27+at+0x104236828%3E&oauth_nonce=08333144&oauth_timestamp=1285951512&oauth_consumer_key=sJsaVBQRT8SdE3WqVE&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&platform=windows&oauth_token=EQ36hNfLL9e2ma47SZ&license_type=bsd&oauth_signature=a63YAXbOgbvxxxpV34uEK2xpZOs%3D&release_notes=fukyeah',
xpi, release_notes, etc are all part of the data payload.
I think Django's test client isn't encoding this right... looks like others have run into this issue, but it was resolved:
http://code.djangoproject.com/ticket/11371
so I don't know why it's still happening for me.
Assignee | ||
Comment 4•14 years ago
|
||
Okay, so the problem is that client.PUT is broken, luckily I can just override that...
Comment 5•14 years ago
|
||
Sorry, just saw this in my bugmail - yeah client.PUT is broken, as is client.POST. They both assume everyone wants to use form-encoded POST vars as a request body. I had to code my own for a test, like so:
http://github.com/lmorchard/badger/blob/badge-api/apps/badges/api/tests.py#LID209
Assignee | ||
Comment 6•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•