Hi
In below code Token is generated . I want it to be a separate class or function. How it can be done
var client = new RestClient("api.nimbuspost.com/v1/users/login"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); var body = @"{" + "\n" + @" ""email"" : ""[email protected]""," + "\n" + @" ""password"" : ""T34!""" + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); dynamic json = JsonConvert.DeserializeObject(response.Content); string token = json.data;
Thanks