wpGetUserInfo method
Sends a request to get a users WordPress info using a valid userToken
.
Returns a WPUserInfoResponse future. Throws an Exception if fails
Implementation
Future<WPUserInfoResponse> wpGetUserInfo({String? userToken}) async {
// send http request
final json = await _http(
method: "POST",
url: _urlForRouteType(WPRouteType.UserInfo),
userToken: userToken,
shouldAuthRequest: true);
// return response
return _jsonHasBadStatus(json)
? this._throwExceptionForStatusCode(json)
: WPUserInfoResponse.fromJson(json);
}