cah4a / dart_nock

HTTP requests mocking library for dart and flutter.
https://pub.dev/packages/nock
MIT License
20 stars 14 forks source link

matching uri with path-params #11

Closed rulila52 closed 2 years ago

rulila52 commented 3 years ago

We can use query, in which, using params, we can perform the necessary actions.

interceptor = nock(baseurl).get(dynamicPath)
        ..query((params) => true)...

But what if I need to check it by path params (https://myUrl/myParam )? Is it possible to access the intercepted url?

cah4a commented 3 years ago

Hey @rulila52,

Library supports matchers for url path: nock(baseUrl).get(startsWith('/myUrl/')).

Is that work for you?