troubleshooting Question

Problem with WebRequest

Avatar of pvg1975
pvg1975Flag for Argentina asked on
.NET ProgrammingASP.NET
3 Comments1 Solution199 ViewsLast Modified:
Hello guys,

Im using the following code, which seems to work fine:

URL = "https://api2.xxxxxxxxxxx.com/user?k=xxxxxxxxxxxxxxxxxxxxxx"
Dim Request2 As HttpWebRequest = WebRequest.Create(URL)
body = "{""external_guid"": """ & Session("userid") & """, ""client_guid"": ""ATR-3dfg43dj56cb7b"", ""email"":""" & Email & """}"
Request2.Method = "POST"
Request2.ContentType = "application/json"
Dim writer As New StreamWriter(Request2.GetRequestStream(), System.Text.Encoding.ASCII)
writer.Write(body)
writer.Close()

The problem is that I have to see the response from the API.

I tried this:

Dim Response2 As HttpWebResponse = Request2.GetResponse

but it returns server 500 error

Any suggestions?

Thanks!
ASKER CERTIFIED SOLUTION
Jini Jose
Senior .Net Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros