Hi all,
Fairly straight forward problem. I have a Post using HttpWebRequest
that posts data to a server. That server then posts data back to me.
Posting the data's not a problem, however I'm wondering if there is an
easy way to read back the variables that are returned. If not, I'm
left creating a parse routine which is not the end of the world but I
just want to be as programatically correct as I can be.
Code:
StreamReader sr = new StreamReader(Ht tpWResponse.Get ResponseStream( ),
System.Text.Enc oding.ASCII);
//Convert the stream to a string
string s = sr.ReadToEnd();
sr.Close();
Response.Write( s);
RETURNS:
s ="trnApproved=1 &trnId=10000843 &messageId=1&me ssageText=Appro ved&authCode=TE ST&errorType=N& errorFields=&av sProcessed=0&av sId=0&avsResult =0&avsAddrMatch =0&avsPostalMat ch=0&avsMessage =Address+Verifi cation+not+perf ormed+for+this+ transaction%2E"
I'd just like a way to read Request["trnApprove d"] or
Request["messageTex t"] - Any ideas?
Thanks,
DB
Fairly straight forward problem. I have a Post using HttpWebRequest
that posts data to a server. That server then posts data back to me.
Posting the data's not a problem, however I'm wondering if there is an
easy way to read back the variables that are returned. If not, I'm
left creating a parse routine which is not the end of the world but I
just want to be as programatically correct as I can be.
Code:
StreamReader sr = new StreamReader(Ht tpWResponse.Get ResponseStream( ),
System.Text.Enc oding.ASCII);
//Convert the stream to a string
string s = sr.ReadToEnd();
sr.Close();
Response.Write( s);
RETURNS:
s ="trnApproved=1 &trnId=10000843 &messageId=1&me ssageText=Appro ved&authCode=TE ST&errorType=N& errorFields=&av sProcessed=0&av sId=0&avsResult =0&avsAddrMatch =0&avsPostalMat ch=0&avsMessage =Address+Verifi cation+not+perf ormed+for+this+ transaction%2E"
I'd just like a way to read Request["trnApprove d"] or
Request["messageTex t"] - Any ideas?
Thanks,
DB
Comment