Results 1 to 2 of 2

Thread: formatting http.response ** RESOLVED **

  1. #1

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    formatting http.response ** RESOLVED **

    I keep getting the following Error
    Code:
    System.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
    VB Code:
    1. Dim auth_key As String
    2.             HttpResp = HttpReq.GetResponse
    3.             objStreamReader = New StreamReader(HttpResp.GetResponseStream)
    4.             'auth_key = objStreamReader.ReadToEnd
    5.             auth_key = Replace(Replace(objStreamReader.ReadToEnd, vbCrLf, ""), " ", "")
    6.  
    7. Response.Redirect(RedirectURL & "?code=" & Trim(auth_key))

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

    Any ideas?
    Last edited by Fishcake; Mar 25th, 2004 at 10:47 AM.

  2. #2

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    Sorted now used this aswell and it finally worked.
    VB Code:
    1. auth_key = auth_key.Replace(Chr(10), "")
    2.             auth_key = auth_key.Replace(Chr(13), "")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width