AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 602 forks source link

Add matcher `hasFormBody` #321

Closed 417-72KI closed 3 years ago

417-72KI commented 4 years ago

Checklist

Description

I've added a matcher called hasFormBody that tests whether the NSURLRequest content-type is application/x-www-form-urlencoded and body contains query parameters.

Motivation and Context

In POST request with application/x-www-form-urlencoded, parameters are handled in httpBody. For that reason, containsQueryParams function is useless for this situation. Also for the same reason as #265, I need a new matcher that takes query items from httpBody and matches with expected pairs.