Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Endpoints which write public content are much harder to test. What's the best way to test the new comments functionality without having to post to real threads?

I have seen the Charles web proxy suggested, but my trial has run out, and if I remember correctly, it was a bit tricky setting it up so that HTTPS endpoints could be used.

If the Stack Apps team is fine with it, I would be happy for other developers to write to this very thread.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This is what preview is for.

Every write method takes a parameter called preview (the test console defaults it to true for testing purposes). When it's explicitly set to true, the method goes through all the validation it otherwise would but stops just short of actually committing the data. Preview calls also don't consume any of a user's write quota.

It's basically built for helping you test that you're calling the API correctly without actually causing any side effects.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .