Click here to Skip to main content
12,501,692 members (44,729 online)
Rate this:
Please Sign up or sign in to vote.
See more: Windows VS2012
Hi All,

I am trying to build an app using VS2012, windows 8. It will display Harvest project([^]).

It wil be a simple call to Authenticate a user and to reterive information after authentication.

see below that's far i have gone:
 HttpClientHandler handler= new HttpClientHandler();
  WebRequest httpRequestLogin ;
  WebResponse loginResponse ;
  System.Net.CredentialCache cred = new CredentialCache();
  HttpResponseMessage r;
  string str;
 httpRequestLogin = (HttpWebRequest)WebRequest.Create(uri);
cred.Add(new System.Uri(uri), "Basic", new System.Net.NetworkCredential("username", "password"));
 httpRequestLogin = (HttpWebRequest)WebRequest.Create(uri);
 httpRequestLogin.ContentType = "application/xml";
I am not sure how to make the http request to the actual website where i need to login?

Any help is greatly appreciated

Posted 21-Sep-12 4:25am
Updated 21-Sep-12 4:27am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Take a look at HttpWebRequest/Response in a Nutshell - Part 1[^], a useful CodeProject article.
kaysha 21-Sep-12 11:30am
Thanks for prompt response

Thanks for prompt response
i will try it and let you know :)

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I found HTTP Basic Authentication[^] and OAuth 2.0 Authentication[^].
They may help...
Marcus Kramer 21-Sep-12 11:35am
These are great for authentication to the local site, but don't really help the OP with authentication calls to a 3rd party site which is what he is asking for. +3 for the answer, but not a 5 because it really is just a little off for the OP's exact needs. Cheers.
Tadit Dash 21-Sep-12 12:06pm
Thanks a lot...
kaysha 21-Sep-12 11:59am
Hi Tadit,

Thanks for you help!

I know the Harvest link you have mentioned.

Please see the link api call ([^])

problem is Visual studio 2012 has change some namespaces. I cannot use the code from Harvest api sample.

It would be really great if someone can provide me code snippet for this API call


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100