Last post Dec 07, 2016 07:29 AM by Chris Zhao
Dec 07, 2016 05:08 AM|IPSa|LINK
I create a Web API, and one of my 'Update' method is like this :
// PUT api/Employee/5
public IActionResult Put(string id, [FromBody]Employee employee)
if (employee == null || employee.ID == id)
Employee dataEmployee = repo.Find(id);
if (dataEmployee == null)
return new NoContentResult();
I want to test it in ARC(Advance REST Client). I try using this URL http://localhost:53417/api/Employee/67b4d7b9-c0cf-435e-8975-9d7f6aa634b2. But nothing happens. I think it's because i don't pass the employee parameter. I have no idea how to pass [FormBody]Employee
model into URL like that. And i'm not found any answer from Google yet.
PS : I'm using ASP.NET Core Web API
Thank you. Sorry for dummy question
Dec 07, 2016 05:38 AM|DA924|LINK
You should learn how to use Fiddler to look at the raw HTML when you get a 404 error.
I don't know what this Core Web API is about, and I probably don't what to know. I don't know what your client is about, but may be you should be using AJAX to make the call form the client to the Web API.
This is in case you don't know what a DTO is.
Just understand what a DTO looks like, and the above purpose.
Dec 07, 2016 06:33 AM|RRummel|LINK
The standard tool for testing Web API's is Postman. Here are some features :
Link to Postman : https://www.getpostman.com/
Dec 07, 2016 07:29 AM|Chris Zhao|LINK
You can send data and view the HTTP response using Postman.