Fix wait argument on POST

Its type was not declared. Adds tests for this.

Change-Id: Iba05ce38f7548cc8400ac78493ef16b5e69905bb