Function pact_ffi::mock_server::handles::pactffi_with_request

source ·
#[no_mangle]
pub extern "C" fn pactffi_with_request(
    interaction: InteractionHandle,
    method: *const c_char,
    path: *const c_char
) -> bool
Expand description

Configures the request for the Interaction. Returns false if the interaction or Pact can’t be modified (i.e. the mock server for it has already started)

  • method - The request method. Defaults to GET.
  • path - The request path. Defaults to /.

To include matching rules for the path (only regex really makes sense to use), include the matching rule JSON format with the value as a single JSON document. I.e.

const char* value = "{\"value\":\"/path/to/100\", \"pact:matcher:type\":\"regex\", \"regex\":\"\\/path\\/to\\/\\\\d+\"}";
pactffi_with_request(handle, "GET", value);

See IntegrationJson.md