Blake Blackwell
Blake Blackwell

Reputation: 7795

HttpClient Communication to WebAPI Project

Is there a good way to debug code from a console app to a web api project in VS2013? For example if I had some code such as:

Web API Controller

// GET api/values
public IEnumerable<string> Get()
{
 return string [] { "value1, value2" };
}

Console Application

var client = new HttpClient();
var results = client.GetStringAsync("http://localhost:35690/api/values").Result;

I know I can use a browser or a tool like CURL. However, where this gets more complicated is handling a multipart form post for a file upload scenario I'd like to support.

Upvotes: 0

Views: 174

Answers (1)

catfood
catfood

Reputation: 4331

If the WebAPI service is part of the same solution as the console application, you can simply set breakpoints wherever you wish and they are respected.

Upvotes: 1

Related Questions