Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:19:50+00:00 2026-05-27T20:19:50+00:00

I am (trying) to develop a WPF (C#) app that just gets (or at

  • 0

I am (trying) to develop a WPF (C#) app that just gets (or at least is supposed to get) my saved bookmarks at Diigo.com profile. The only helpful page i found is this . It says i have to use HTTP Basic authetication to get my self authenticated and make requests then. But don’t understand how C# handles it!. The only solution i came up with below just prints entire HTML source to console window.

string url = "http://www.diigo.com/sign-in";

WebRequest myReq = WebRequest.Create(url);
string usernamePassword = "<username>:<password>";
CedentialCache mycache = new CredentialCache();
mycache.Add(new Uri(url), "Basic", new NetworkCredential("username", "password"));
myReq.Credentials = mycache;
myReq.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new     ASCIIEncoding().GetBytes(usernamePassword)));
 //Send and receive the response
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
string content = reader.ReadToEnd();
Console.Write(content);

Here username and password are hardcoded but of course they’ll come from some txtUsername.Text thing. And after that how am i going to read the JSON response and parse it?
What is that i need to do to get my app or myself HTTP basic authenticated?
Any help or suggestion is welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:19:51+00:00Added an answer on May 27, 2026 at 8:19 pm

    Ok i solved the problem after some (not really some) effort. Code below gets the JSON response from server which can then be parsed using any preferred method.

     string key = "diigo api key";
     string username = "username";
     string pass = "password";
     string url = "https://secure.diigo.com/api/v2/";     
     string requestUrl = url + "bookmarks?key=" + key + "&user=" + username + "&count=5";
     HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(requestUrl);
     string usernamePassword = username + ":" + pass;
     myReq.Timeout = 20000;
     myReq.UserAgent = "Sample VS2010";
     //Use the CredentialCache so we can attach the authentication to the request
     CredentialCache mycache = new CredentialCache();
     //this perform Basic auth
     mycache.Add(new Uri(requestUrl), "Basic", new NetworkCredential(username, pass));
     myReq.Credentials = mycache;
     myReq.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword)));
      //Send and receive the response
      WebResponse wr = myReq.GetResponse();
      Stream receiveStream = wr.GetResponseStream();
      StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
      string content = reader.ReadToEnd();
      Console.Write(content);
    

    content is the JSON response returned from server
    Also this link is useful for getting started with api.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C#/WPF app. I am trying to create different versions that will
I am trying to develop a mobile app, that registered with a Java program
I'm trying to develop a Hybrid android app where all by logic to get
I'm trying to develop a very simple app that displays like a slideshow of
Im trying to develop my first ASP.NET MVC web app and have run into
I'm trying to develop an application that will use getImageData in javascript in Firefox
I'm trying to develop a firefox extension that inserts additional HTTP header fields into
I'm trying to develop a basic GPA Calculator. I have an AllCourses class that
I am trying to develop a sample application that finds the process name of
I'm trying to develop an external library (not sure if that's the right term)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.