This topic is locked

httpRequest

8/4/2018 7:08:00 PM
ASPRunner.NET General questions
S
stevehodges author

In c# I can use the code below to do a remote post to get data response. How can I do this in ASPRunner.net?
Thank you for your assistance
var httpRequest = (HttpWebRequest)WebRequest.Create("http://localhost/service.svc";);

var httpRequest.Method = "POST";
using (var outputStream = httpRequest.GetRequestStream())

{

// some complicated logic to create the message

}
var response = httpRequest.GetResponse();

using (var stream = response.GetResponseStream())

{

// some complicated logic to handle the response message.

}

admin 8/9/2018

If your code works outside of ASPRunner.NET it will work in ASPRunner.NET events as well. The problem is that you are not providing any info that would help us help you.
Are there any error messages during build or during execution?

S
stevehodges author 8/28/2018

Sorry for the delayed response. I would like to send an http/https post request and read the response into a JSON parser. In this example I am using a public test url with a JSON response.
Target URL

https://jsonplaceholder.typicode.com/todos/1
Response Code

{

"userId": 1,

"id": 1,

"title": "delectus aut autem",

"completed": false

}

admin 8/28/2018

This doesn't answer my question.