Skip to content

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

@bunnywrote

Description

@bunnywrote

I try to post via bufferApi, but it was returned "The remote server returned an error: (400) Bad Request."

I do it like this:

` public static void Main(string[] args)
{
var token = _accessToken;
var service = new BufferService(token);
var profileResult = service.GetProfiles();

        var allProfiles = profileResult.Result;
        var twitterProfiles = allProfiles.Content.Where(x => x.Service == "twitter");

        Posting(service, twitterProfiles);

        Console.ReadLine();
    }
    private static async void Posting(BufferService service, IEnumerable<BufferProfile> profile)
    {
        try
        {
            var response = await service.PostUpdate("From Buffer", profile.Select(e => e.Id));
            Console.WriteLine(response.StatusCode);

        }
        catch (OperationCanceledException ex)
        {
            Console.WriteLine(ex.Message);
        }
    }`

Could you say me, whats going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions