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
  • 14,208
  • 10
  • 51
  • 80

1 Answers1

2

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

See also this question.

Community
  • 1
  • 1
koma
  • 6,486
  • 2
  • 27
  • 53