Permalink
Browse files

Create rating example

  • Loading branch information...
1 parent 28c1355 commit 37effc3b1f58a496b038c4e009104bb6e19cd9f8 @joaquincasares joaquincasares committed Jul 9, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.md
View
@@ -86,4 +86,23 @@ except NetflixAPIError:
del_from_queue = n.delete('http://api-public.netflix.com/users/*final_user_id*/queues/instant/available/2/70072945')
print del_from_queue
+```
+
+###### Rate Gabriel Iglesias: Hot and Fluffy
+```python
+try:
+ # Create a new rating
+ create_rating = n.post('users/*final_user_id*/ratings/title/actual/70072945', params={'rating': '5'})
+
+ print create_rating
+except NetflixAPIError:
+ # This returns a status message if successful.
+ # If it's already been rated, it will return a NetflixAPIError, code 422
+ pass
+
+
+# Update/Clear rating
+update_rating = n.put('users/*final_user_id*/ratings/title/actual/70072945', params={'rating': 'no_opinion'})
+
+print update_rating
```

0 comments on commit 37effc3

Please sign in to comment.