Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. at my wit's end: http auth

at my wit's end: http auth

Scheduled Pinned Locked Moved C#
htmlcomxmljsonhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sharkfish
    wrote on last edited by
    #1

    del.icio.us links uses http auth. I send a link such as: http://username:password@del.icio.us/api/posts/add?&url=http://www.engadget.com/&description=engadget&extended=engadget&tags=blog&dt=3/10/2005 12:34:49 AM with my username and password, and I get the little xml snippet via html <result code='done'> If I try to grab this result code with string lcUrl="http://username:password@del.icio.us/api/posts/add?&url=http://www.engadget.com/&description=engadget&extended=engadget&tags=blog&dt=3/10/2005 12:34:49 AM" // *** Establish the request HttpWebRequest loHttp = (HttpWebRequest) WebRequest.Create(lcUrl); // *** Set properties loHttp.Timeout = 10000; // 10 secs loHttp.UserAgent = "code I borrowed trying to do this dang-it!"; // *** Retrieve request info headers HttpWebResponse loWebResponse = (HttpWebResponse) loHttp.GetResponse(); Encoding enc = Encoding.GetEncoding(1252); // Windows default Code Page StreamReader loResponseStream = new StreamReader(loWebResponse.GetResponseStream(),enc); string lcHtml = loResponseStream.ReadToEnd(); loWebResponse.Close(); loResponseStream.Close(); I get the 401 error. I am trying to stream out the result code so I can store it in a string variable. Any guidance is appreciated.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups