def api_view_source(request): """View Source for android & ios source file.""" params = ['file', 'type', 'hash'] if set(request.POST) >= set(params): if request.POST['type'] in ['eclipse', 'studio', 'apk']: resp = view_source.run(request, api=True) else: resp = ios_view_source.run(request, api=True) if 'error' in resp: response = make_api_response(resp, 500) else: response = make_api_response(resp, 200) else: response = make_api_response({'error': 'Missing Parameters'}, 422) return response
def api_view_source(request): """ View Source for android & ios source file """ params = ['file', 'type', 'hash'] if set(request.POST) >= set(params): if request.POST["type"] in ["eclipse", "studio", "apk"]: resp = view_source.run(request, api=True) else: resp = ios_view_source.run(request, api=True) if "error" in resp: response = make_api_response(resp, 500) else: response = make_api_response(resp, 200) else: response = make_api_response({"error": "Missing Parameters"}, 422) return response