def get(self,key): response = Response() response.headers['Content-Type'] = "audio" response.headers['Content-Disposition'] = "attachment" try: manager = SongDelegate('Song') result = manager.getFile(key.split('.')[0]) except Exception,e: result = self.wrapFault(e.message)
def post(self, **kwargs): params = { "url": self.request.form.get('url'), "name" : self.request.form.get('name'), "artist" : self.request.form.get('artist') } manager = SongDelegate('Song') manager.add(params) return self.get(**kwargs)