I have the following POST method definded in OpenAPI:
post:
tags:
- Courses
description: Creates a new Course and add it to specified Program
parameters:
- name: Program
in: path
description: Specified Program to add the new course to
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Course'
In insomnia I can define the Course
object, I want to add via the body/JSON tab, however how can I define the needed parameter? It doesn't work in the Query tab the same way it does for GET methods.
Do I manually set the path of the POST request with the parameter, or is there a build in way (or is it not possible at all)?
Here is the curl when trying to add the Program Parameter in the Query tab:
curl --request POST \
--url 'http://localhost:8080/Courses?Program=Testprogram' \
--header 'content-type: application/json' \
--data '{
"name": "TestCourse",
"type": "UE",
"etcs": 26,
"courseID": 909090
}'