@api_view(['GET'])
def gatewayentities_list(request,format=None):
requestMeta = request.META
if ('HTTP_AUTHORIZATION' not in requestMeta.keys()):
return JSONResponse({"status": "UNAUTHORIZED"}, status=401)
elif (requestMeta['HTTP_AUTHORIZATION'] is not None):
headerParameters = requestMeta['HTTP_AUTHORIZATION'].split(" ")
companyid_id = headerParameters[2]
apikey = headerParameters[0]
userId = headerParameters[3]
try:
applicationid = int(headerParameters[4])
except IndexError:
applicationid = 0
{'Transfer-Encoding':'chunked','Vary':'Cookie','Server': 'Apache / 2.2.29(亚马逊)','连接':'关闭','日期':'星期三,06 Jun 2018 06:50:09 GMT','Content-Type':'text / html;字符集= UTF-8' }
Server Error (500)
任何帮助将不胜感激!
答案 0 :(得分:0)
您得到的错误似乎与请求映射标题无关。
您的请求映射方法应该类似于:
@RequestMapping(produces = "application/json", method = RequestMethod.GET, value = "data")
public @ResponseBody ResponseEntity<?> gatewayentities_list(@ModelAttribute ,BindingResult errors, HttpServletRequest request, HttpServletResponse response){
// your code.
}