Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to simulate a .NET HTTP response?

I’m developing a C# .NET Framework application which has to parse status protocols from different devices in the JSON format.
These protocols are obtained via http requests (System.Net.WebRequest and .Response). I don’t have the opportunity to receive these protocols directly from the devices, but I have a technical specification. So I need to simulate the response.
How can I test this: I need a URL where I can store my JSON data and from where I can receive and load this data into my applicaton.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can just read the JSONs from a file(s) to "simulate" a response. If you want to make HTTP-Requests then you have to use a mocked API. For this purpose you can try Mocky. Just click on NEW MOCK on the website and create your custom mocked API. You will get an URL that will response with the headers and data that you configured.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading