Replies: 1 comment 1 reply
-
I'm afraid Refit doesn't support either examples. In your case i would do the following: var client = RestService.For<IUserClient>("http://localhost:10000/api/user");
var user = await client.GetUser("LimOpsx", "myPassword");
// calls http://localhost:10000/api/user/getUser?username=LimOpsx&passwordHash=myPassword
public interface IUserClient
{
[Get("/getUser")]
public Task<User> GetUser(string username,string passwordHash);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
`[Url("http://localhost:10000/api/user")]
public interface IUserClient
{
}
, OR IUserClient.CS
[Url("userServerAddress")]public interface IUserClient
{
}` Then read the request address from appsettings. json
"userServerAddress":"http://localhost:10000/api/user"
Beta Was this translation helpful? Give feedback.
All reactions