While generating token, the username and password should be in body or in URL?
I tried both was but not getting token
When making the request, you can put them in the url as parameters for username and password. Something like this
Also, you have to make sure to allow ArcGIS Server to serve tokens through GET requests.
Enable token acquisition through an HTTP GET request—ArcGIS Server Administration (Windows) | ArcGIS Enterprise
Retrieving data ...