How to access header values of request in Java Restlet?

前端 未结 5 1276
挽巷
挽巷 2021-01-13 20:23

I am developing web services using Restlet Java.

For this I want to protect some webservices from unauthorized clients. So I have written Filter cla

5条回答
  •  粉色の甜心
    2021-01-13 20:34

    If you are using Restlet 2.1-RC3 this is the way to get it

     Series
    headers = (Series
    ) getRequestAttributes().get("org.restlet.http.headers"); String auth = headers.getFirstValue("auth");

    This is exactly how it's worked for me. None of the answers above did it. I hope it helps.

提交回复
热议问题