def share_comment(request): ''' restful api post share conversion result(image and other attributes) ''' response = None if request.method == 'GET': #method = request.GET.get('method', 'units.search') #extras = request.GET.get('extras', None) _format = request.GET.get('format', 'json') api_key = request.GET.get('api_key', None) try: restapi = RestAPI(api_key) result = restapi.share_comment(_format) response = HttpResponse(result, mimetype="application/json;charset=utf-8") except Exception, e: response = HttpResponseForbidden('failed to get sharing comments %s' % e)