I was looking for a sample test application in C# which could test WCF rest api call?
I couldn’t find one on the internet.
I have some login credentials for that wcf end point as well which I need to pass.
Can someone point me to sample test rest api appln?
Thanks
I think using
WebClientshould work for WCF REST services (if you need, you can use credentials, request headers, etc):EDIT: Example for web application which uses Forms authentication.
My previous example works if the web application allows anonymous users. If not (web.config contains
<deny users="?"/>and Anonymous access is enabled in IIS), two requests are required:the request to the login page to authenticate;
the request to the actual service url.
The auth cookie should be passed to the second request (we use the
CookieContainerobject to achieve this).The first call passes the user name and password using the POST method. Because my web application uses out-of-the-box login control, I need to pass the view state, event validation, etc. You can get the form data passed during the login from a web browser using Fiddler or Chrome dev tools. This is the code: