I have Wordpress and JWT Auth installed and I want to validate a username and password.
I simply want to pass the username and password through the JWT Token API using my C# code.
Here's the API link that's working in Postman:
https://xxxx/wp-json/jwt-auth/v1/token
I can only pass the username and password in the "Body" "Form-Data" fields with the key values "username" and "password" because parameters don't work with JWTAuth.
How do I pass these values as a "Body" "Form-Data" value using C#?
Here's my code:
string JWTAPI = "https://xxxx/wp-json/jwt-auth/v1/token";
var client = new HttpClient();
var uri = JWTAPI;
var jsonContent = "{ \"username\": \"test\", \"password\": \"test\"}";
string json = JsonConvert.SerializeObject(jsonContent);
StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
var response_status = await client.PostAsync(uri, content);
var response_result = await response_status.Content.ReadAsStringAsync();