0

I have an api endpoint defined as follows

@Api (name = "auth", version = "1")
public class AuthenticationEndpoint {

    @ApiMethod 
    public AuthResult Register (@Named ("email") String email, @Named ("password") String pass) {
        // TODO: do something with the user agent here
    }    
}

Is there any way to access the user agent here in my Register method?

Thanks

copolii
  • 13,790
  • 10
  • 48
  • 78

1 Answers1

2

You can add a parameter of type HttpServletRequest to the method.

See also this question.

Community
  • 1
  • 1
koma
  • 6,417
  • 2
  • 25
  • 52