Hi, i cant create a post using the version 2.0.1
This is the Code:
var client = new WordPressClient( "http://sitioweb.com/wp-json/" );
client.Auth.UseBasicAuth( "username", "app_password" );
var post = new Post() {
Title = new Title( "ITCmx" ),
Content = new Content( "Content PostCreate" )
};
var createdPost = await client.Posts.CreateAsync( post );
And get this error
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'WordPressPCL.Models.Post' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
I try on Postman and works fine
Could you please help me
Thank you
Hi, i cant create a post using the version 2.0.1
This is the Code:
And get this error
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'WordPressPCL.Models.Post' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
I try on Postman and works fine
Could you please help me
Thank you