Generate requests
After creating an endpoint specification or importing an API spec, you can generate and send requests for debugging and validation.
Generate request param
In Apidog's DESIGN
mode, once you have specified an endpoint in Edit
tab, you can click the Run
tab to switch to the sending request interface. Here, the corresponding request is automatically generated based on the endpoint specifications that you have defined.
For path parameters
, query parameters
, headers
, and body parameters
of type form-data
or x-www-form-urlencoded
, if you have specified an example
in the endpoint specification, this example will automatically populate the value
field in the Run
interface as the initial request parameter value.
:::tip[]
If the parameters such as param name, description, type, or example in the endpoint specification
are modified and saved in the Edit
tab, the corresponding fields in the Run
tab will also be updated accordingly. Any changes made in the spec will reflect across the entire development process, maintaining consistency and accuracy.
:::
Generate request body
If your request body is of JSON
or XML
type, you can automatically generate the request body within Apidog without manually constructing it.
If your endpoint specification includes a defined body example, this example will appear in the Run
tab as the initial body content.
If there is no body example defined in the endpoint specification, the body field in the "Run" tab will be left blank. However, you can click on Generate Automatically
to create a body structure that fits your requirements.
Generate automatically provides several different data generation options, including:
Directly clicking
Generate automatically
: Generates mock data based on smart mock rules.Generate keys only
: Generates only the keys defined in the schema without values, useful when values require customization.Use field default value
: Utilizes default values from the schema as values to generate JSON; if not available, smart mock data is used as values.Use field example value
: Prefers schema-defined examples as values to generate JSON; resorts to smart mock data if examples are not available.Use request example
: Utilizes the entire JSON example defined in the schema as values to generate JSON; defaults to smart mock data if examples are not available.Regenerate each sending
: Regenerates data following smart mock rules each time a request is sent.
When regenerate each sending
is enabled, the body content becomes uneditable until this option is disabled.
Insert dynamic value
You can use dynamic values
to generate values for both request parameters and request body. This allows dynamic values to be automatically mocked and inserted into the request each time it is sent.
Next to the input box for each request parameter, you will see a
Similarly, in the request body, you can click on the
:::highlight purple
Learn more about Dynamic values.
:::
Send request
Click Send
to send the request.
:::highlight purple
Learn more about Send requests.
:::