BodyPattern: BodyPattern

BodyPatternR Documentation

BodyPattern

Description

body matcher

Public fields

pattern

a list

partial

bool, default: FALSE

partial_type

a string, default: NULL

Methods

Public methods


Method new()

Create a new BodyPattern object

Usage
BodyPattern$new(pattern)
Arguments
pattern

(list) a body object - from a request stub (i.e., the mock)

Returns

A new BodyPattern object


Method matches()

Match a request body pattern against a pattern

Usage
BodyPattern$matches(body, content_type = "")
Arguments
body

(list) the body, i.e., from the HTTP request

content_type

(character) content type

Returns

a boolean


Method to_s()

Print pattern for easy human consumption

Usage
BodyPattern$to_s()
Returns

a string


Method clone()

The objects of this class are cloneable with this method.

Usage
BodyPattern$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


webmockr documentation built on June 29, 2025, 9:06 a.m.