Skip to content

UseBasicAuth not work #373

Description

@masgh021

Hi everyone
I use this code but got this error that my password is not correct , I test username and pass in browser and it is correct .
what is the problem ?
var client = new WordPressClient("https://test.com/wp-json/");

client.Auth.UseBasicAuth("admin", "pass ";
var wpUser = new WordPressPCL.Models.User(); 
wpUser.Email = "test@lastsss.com";
wpUser.FirstName = "aa";



try
{
    client.JsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() { DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore };
    wpRespond = await client.Users.CreateAsync(wpUser);
}
catch (WPException wpex)
{
  
    throw wpex;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions