diff --git a/post_test.go b/post_test.go index bb6c578..c76f251 100644 --- a/post_test.go +++ b/post_test.go @@ -3,6 +3,7 @@ package writeas import ( "testing" + "fmt" "strings" ) @@ -71,3 +72,20 @@ func TestGetPost(t *testing.T) { } } } + +func ExampleClient_CreatePost() { + c := NewClient() + + // Publish a post + p, err := c.CreatePost(&PostParams{ + Title: "Title!", + Content: "This is a post.", + Font: "sans", + }) + if err != nil { + fmt.Printf("Unable to create: %v", err) + return + } + + fmt.Printf("%+v", p) +}