Forum Discussion
Sadeesh
New Contributor
AlexKaras Thanks for your reply and as I mentioned, I need to deal with multipart/form-data requests but I didn't see any appropriate method in the interface https://docs.microsoft.com/en-gb/windows/win32/winhttp/iwinhttprequest-interface?redirectedfrom=MSDN which used byaqHttp object.
So only moved on to ReadyAPI.
Sadeesh
4 years agoNew Contributor
Thanks, AlexKaras for the kind update.
Here are the sample cURL requests
//POST request
1. curl --location --request POST 'URL/oauth/token' \
--header 'Cookie: "XXXXXXXXX"' \
--form 'VAR1="VALUE1"' \
--form 'VAR2="VALUE2"' \
--form 'VAR3="VALUE3"' \
--form 'VAR4="VALUE4"'
//subsequent GET request where the output value from POST request will be referred
2. curl --location --request GET 'XXXX/create-data' \
--header 'X-OAuth-Authorization:
: "token value from the above request"' \
: "token value from the above request"' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Cookie: XXXXXX'
//final response where the "VALUE6" needs to grabbed and pass to UI tests
Response:
{
"status": 200,
"body": {
"VAR5": "VALUE5",
"VAR6": "VALUE6",
....
}
}
Notes:
1. Though as mentioned in the document, This type of form-data request can be achieved without ReadyAPI with third-party requests package especially in python-script but I also saw a note in Python script documentation that dealing with third-party packages are not the recommended approach as it is not stable during execution.
2. Since having cURL requests and seems this is possible without ReadyAPI Integration by referring following threads:
Related Content
- 3 years ago
- 5 years ago
- 5 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago