PDA

Click to See Complete Forum and Search --> : formatting http.response ** RESOLVED **


Fishcake
Mar 25th, 2004, 09:30 AM
I keep getting the following ErrorSystem.ArgumentException: Redirect URI cannot contain newline characters. at System.Web.HttpResponse.Redirect(String url, Boolean endResponse) at System.Web.HttpResponse.Redirect(String url) at club256

When trying to response.redirect using the following code Dim auth_key As String
HttpResp = HttpReq.GetResponse
objStreamReader = New StreamReader(HttpResp.GetResponseStream)
'auth_key = objStreamReader.ReadToEnd
auth_key = Replace(Replace(objStreamReader.ReadToEnd, vbCrLf, ""), " ", "")

Response.Redirect(RedirectURL & "?code=" & Trim(auth_key))

I can't see why the string 'AuthKey' still has a newline char in it.

Any ideas?

Fishcake
Mar 25th, 2004, 09:49 AM
Sorted now used this aswell and it finally worked.

auth_key = auth_key.Replace(Chr(10), "")
auth_key = auth_key.Replace(Chr(13), "")