Function pact_mock_server_ffi::with_binary_file[][src]

#[no_mangle]
pub extern "C" fn with_binary_file(
    interaction: InteractionHandle,
    part: InteractionPart,
    content_type: *const c_char,
    body: *const u8,
    size: size_t
) -> bool
Expand description

Adds a binary file as the body with the expected content type and example contents. Will use a mime type matcher to match the body. Returns false if the interaction or Pact can’t be modified (i.e. the mock server for it has already started)

  • interaction - Interaction handle to set the body for.
  • part - Request or response part.
  • content_type - Expected content type.
  • body - example body contents in bytes
  • size - number of bytes in the body