asked on
I want to upgrade this file to POST instead of GET and have hit a problem.
The following code works if Method is "GET" and fails if "POST"
Error is:
Error Information: Unhandled Exception
<%@WebHandler Language="C#" Class="APIHandler"%>
using System;
using System.Web;
using System.Xml;
using System.Net;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
public class APIHandler:IHttpHandler
{
public bool IsReusable{get{return true;}}
public void ProcessRequest(HttpContext context){
HttpRequest request=context.Request;
HttpResponse response=context.Response;
String URLreq = "http://172.18.129.120/connect/default.asp" ;
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(URLreq);
myRequest.Method = "POST";
WebResponse myResponse = myRequest.GetResponse();
}
}