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 6360367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:38:26+00:00 2026-05-24T23:38:26+00:00

I am sending a request to Facebook Graph API by using WebClient with the

  • 0

I am sending a request to Facebook Graph API by using WebClient with the following code that is written in an ASP.net MVC Controller class:

 WebClient client2 = new WebClient();

        Stream data2 = client2.OpenRead("https://graph.facebook.com/me&" + s);
        StreamReader reader2 = new StreamReader(data); //Error


        string s2 = reader2.ReadToEnd();
        data2.Close();
        reader2.Close();

        s2=s2.Substring(s2.IndexOf('"', s2.IndexOf(':')), s2.Length - s2.IndexOf('"', s2.IndexOf(':')));

        s2= s2.Substring(1, s2.IndexOf('"', 1) - 1);

        return "AccessToken Stored in session, Current Signed in user is: "+s2;

I am getting this error: “System.ArgumentException: Stream was not readable.” at the line commented as //Error. This request to https://graph.facebook.com returns data in JSON format. Is that causing this exception? Please help. How do I resolve this issue?

  • 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-24T23:38:27+00:00Added an answer on May 24, 2026 at 11:38 pm

    I might be pointing out the obvious, but you are passing the “data” variable into the StreamReader constructor right after creating the “data2” variable. I am guessing that you meant to pass in “data2” instead?

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

Sidebar

Related Questions

I'm using the graph api in iOS. I'm sending request to each of the
I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object.
I'm trying to use Net::SSH::Perl to connect using public keys with this code: my
I am sending a request using post, but on firebug I see the request
I'm using graph api from youtube , and i am facing some trouble .
Sending request to action using Ajax, the result type is json. Use a json
Sending request with URL length ~ 4950 characters. Getting the following XMLHTTPRequest.ResponseText: ERROR The
My Aim: Sending an email (e.g. support request, error report) out of a C#
Sending a message from the Unix command line using mail TO_ADDR results in an
M sending the parameters from the jsp page, the code is <s:url id=url action=searchAction>

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.