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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:07:13+00:00 2026-06-12T07:07:13+00:00

I am try to update a user score on a Facebook leaderboard using the

  • 0

I am try to update a user score on a Facebook leaderboard using the following code:

string _url = "https://graph.facebook.com/MY_APP_ID/scores";
var _parameters="score=100&access_token=MY_APP_TOKEN_WITH_PUBLISH_ACTION";
WebRequest _request = WebRequest.Create(_url);
_request.Method = "POST";                 
var _dataArray = Encoding.ASCII.GetBytes(_parameters.ToString());                
_request.ContentLength = _dataArray.Length;

using (Stream _dataStream = _request.GetRequestStream())
{
    _dataStream.Write(_dataArray, 0, _dataArray.Length);
}
WebResponse _response = _request.GetResponse();

When I try to get the response the application throws an exception:

The remote server returned an error: (400) Bad Request.

What am I doing wrong?

  • 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-06-12T07:07:14+00:00Added an answer on June 12, 2026 at 7:07 am

    I’m actually in the middle of something similar with LinkedIn. Wrap it in a try block and try this exception handler:

    catch (WebException webEx) {
        StringBuilder sb = new StringBuilder();
    
        sb.AppendLine(webEx.Message);
    
        sb.AppendLine();
        sb.AppendLine("REQUEST: ");
        sb.AppendLine();
    
        sb.AppendLine(string.Format("Request URL: {0} {1}", webRequest.Method, webRequest.Address));
        sb.AppendLine("Headers:");
        foreach (string header in webRequest.Headers) {
            sb.AppendLine(header + ": " + webRequest.Headers[header]);
        }
    
        sb.AppendLine();
        sb.AppendLine("RESPONSE: ");
        sb.AppendLine();
    
        sb.AppendLine(string.Format("Status: {0}", webEx.Status));
    
        if (null != webEx.Response) {
            HttpWebResponse response = (HttpWebResponse) webEx.Response;
    
            sb.AppendLine(string.Format("Status Code: {0} {1}", (int) response.StatusCode, response.StatusDescription));
            if (0 != webEx.Response.ContentLength) {
                using (var stream = webEx.Response.GetResponseStream()) {
                    if (null != stream) {
                        using (var reader = new StreamReader(stream)) {
                            sb.AppendLine(string.Format("Response: {0}", reader.ReadToEnd()));
                        }
                    }
                }
            }
        }
    
        _log.Warn(sb.ToString(), webEx);
    
        throw new Exception(webEx.Message, webEx);
    }
    

    That’ll at least log what they’re returning. In my case, I couldn’t reproduce the problem on my system, but QA’s servers were getting a ton of 400 Bad Requests. Turned out they were invalid timestamps because the system clocks were 7 minutes slow, and LinkedIn was rejecting the timestamp.

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

Sidebar

Related Questions

I try to update database table and this is my code: public void updatefiletable(String
Trying to post a status update using facebook php sdk. Code posted below. As
I try to update a column in an table with the following query. In
I try to update my profile image and use this code: $connection->post('account/update_profile_image', array('image' =>
I try to update a table using another table. I get the error number
I have this code for update: public Boolean update() { try { data.put(ContactsContract.Groups.SHOULD_SYNC, true);
I have a DAO class which I'm using to try select/update/insert with hibernate and
I am using SQL Server 2000. When I try to update a column of
I am reading the book Facebook Platform Development in order to try to code
I am trying to update a user information and get the following error: Object

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.