Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what link must generated if I do post url action ?


suppose i have action result as below :

C#
public class Users
    {
        public string UserName { get; set; }
        public string Password { get; set; }
    }
public const string SecurityLogin = "Security";
        public static class Login
        {
            public const string UserLogin = SecurityLogin + "/Login/";

        }
 [HttpPost(Contracts.ApiRoutes.Login.UserLogin)]
        public  IActionResult PostUserLogins([FromBody]Users user)
        {
        }

suppose i need to connect it from postman

what i will write on post man : Security/Login/User or what

and if i user post action like that :


what link will be : Security/Login/User/username/password or what i write

What I have tried:

C#
[HttpPost(Contracts.ApiRoutes.Login.UserLogin)]
        public  IActionResult PostUserLogins([FromBody]string username ,[FromBody] string password)
        {
        }
Posted
Updated 6-Sep-19 7:33am

1 solution

The URL will simply be https://yoursite/path-to-your-api/Security/Login/. The username and password will be passed in the request body.

https://learning.getpostman.com/docs/postman/sending_api_requests/requests/#request-body[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900