Closed byapparov closed 7 years ago
I didn't implement it initially because I didn't need it; the APIs I was working with were mostly CRUD, so POST was a write, not a read.
I left a comment for where I'd handle it: https://github.com/nealrichardson/httptest/blob/master/R/mock-api.R#L83
Probably like:
if (method != "GET") {
f <- paste0(f, "-", method)
}
Also would need to remove the "GET" method checks in https://github.com/nealrichardson/httptest/blob/master/R/mock-api.R#L34.
That'll work if you're looking to mock a POST (or any other verb) that returns 200 status with content. Anything else (other statuses, headers, etc.) will be more involved to implement.
Hi Neal,
Thank you for details, I think this should get me going.
Some data related APIs have two step execution, where the first call is POST with request details (e.g. query) and second call is a GET to URI from the initial POST.
I want to make tests on the original post to see that URI can be extracted.
Now is addressed here: https://github.com/nealrichardson/httptest/pull/4
Hi,
I am looking to add support of
POST
requests to your package and at this point not sure why did you restrict it toGET
in the first place.How do you think the path to a fake file will be different?
Thanks Bulat