Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Streams and Data Processing Streaming Data on the Net Deserialize the News Results

Aaron Selonke
Aaron Selonke
10,323 Points

How to see the request in the IDE?

Is there a way to see the full request in the IDE when running this application? When running a GET or POST request in JavaScript in the Browser, you can see the request with the headers. Is there a way to see that when running a request in IDE Debug mode?

1 Answer

Yes there is. I'm not sure how you would do it with this example ( a console application and a rest API), but you can do it with ASP.NET MVC. You just need a certain class and namespace in .NET. With Visual Studio there is a class called Debug in the namespace Diagnostics. You can use this class in a console application or a web application. Just add the using statement:

using System.Diagnostics;

Then you can use the Debug class (only during debug mode) and the results will appear in Visual Studio's output console as long as you do something like call the function Debug.WriteLine(). So, for example, you might check to see if a string got properly sent to the server Asynchronously using AJAX. To do this, you could attempt to log it to the console like this:

Debug.WriteLine(someString);

Hope that helps.