Home > front end >  How to simulate a .NET HTTP response?
How to simulate a .NET HTTP response?

Time:06-10

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.

CodePudding user response:

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.

  • Related