Generate request param#
In Apidog's Design-first 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
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.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.Request body examples and initial content#
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 Auto-generate
to create a body structure that fits your requirements.Auto-generate options#
Apidog version 2.7.0 or later is reqiured.
Apidog provides a variety of data auto-generation options to meet different needs. You can select from multiple generation methods in the Auto-generate
dropdown menu:1. Examples#
Feature: Manually selects a predefined request body example.
Use Case: Manually switch between predefined examples for different business scenarios, such as normal requests, exception requests, or boundary value testing.
2. Generate each time#
Feature: Regenerates data following smart mock rules each time a request is sent. Use Case: Ideal for dynamic data requirements.
Note: When Generate Each Time
is enabled, the body content becomes uneditable until this option is disabled.
3. Auto-generation preference#
ClickingAuto-generation Preference
opens a pop-up window where you can select the rules you prefer for automatically generating data.Feature: If example values are defined in the request data schema, they will be used for automatic generation. If no example values are configured, a random value will be generated based on the Mock rules.
Use Case: Ideal for scenarios where some fields require fixed values, while others can be dynamically generated.
Feature: If default values are defined in the request data schema, they will be used for automatic generation. If no default values are configured, a random value will be generated based on the Mock rules.
Use Case: Suitable for debugging scenarios where preset values need to be retained.
Feature: Generates data based on Smart Mock rules.
Use Case: Quickly generate complete test data.
Generate Field Names OnlyFeature: Generate field names only using the request data schema, leaving values blank.
Use Case: Useful for testing scenarios where specific values need to be manually filled in.
Feature: Randomly selects a predefined request example.
Use Case: Quickly switch between different business scenarios, such as normal or exception requests.
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 magic wand icon for dynamic variables β clicking this icon will insert a dynamic value.Similarly, in the request body, you can click on the Insert Dynamic Value button to insert dynamic values within JSON or XML bodies.Send request#
Click Send
to send the request.Modified atΒ 2025-05-19 08:40:49