@@ -3,6 +3,7 @@ package writeas | |||||
import ( | import ( | ||||
"testing" | "testing" | ||||
"fmt" | |||||
"strings" | "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) | |||||
} |