HTTP request v20+ not expanding switch variables (maybe?)
Posted: Sat Nov 23, 2024 3:19 am
Hi,
we are able to complete a request with POST a body, custom, set to Hard Coded values of
but it fails with "Request finish status: Unsupported Media Type; status code: 415; status description: 415; last error: Request failed with status code 415" when we use variables
To make the hardcoded version, I highlighted each variable, eg [Job.PrivateData:Key="Consignment"] copied the value that Switch was returning, then pasted it in place of the variable. In theory then Switch can see the value, and the value works.
Other settings are
URL: the URL we need to use and this is the same whether we test with hardcoded or switch variables so should not be a factor
Request Type: POST a body
Body content: Custom
Custom body: as shown in the code snips above
Authentication scheme: None
Parameters:
Headers:
Response: Attach as dataset
Dataset name: HTTPResponse
Dataset model: Automatic
Response headers: Discard
Retry after failed connection: No
Ignore server certificate errors: No
we are able to complete a request with POST a body, custom, set to Hard Coded values of
Code: Select all
{
"ExternalConsignment": {
"ConsignmentNo": "34CAW2079918",
"ConsignmentTrackingCode": "34CAW2079918",
"ConsignmentTrackingURL": "https://auspost.com.au/mypost/track/#/search",
"ExternalConsignmentDeliveries": [
{
"DeliveryKey": "584659",
"DeliveryTrackingCode": "34CAW2079918",
"DeliveryTrackingURL": "https://auspost.com.au/mypost/track/#/search"
}
]
}
}
Code: Select all
{
"ExternalConsignment": {
"ConsignmentNo": "[Job.PrivateData:Key="Consignment"]",
"ConsignmentTrackingCode": "[Job.PrivateData:Key="Consignment"]",
"ConsignmentTrackingURL": "[Job.PrivateData:Key="URL"]",
"ExternalConsignmentDeliveries": [
{
"DeliveryKey": "[Job.PrivateData:Key="FDKey"]",
"DeliveryTrackingCode": "[Job.PrivateData:Key="Consignment"]",
"DeliveryTrackingURL": "[Job.PrivateData:Key="URL"]"
}
]
}
}
Other settings are
URL: the URL we need to use and this is the same whether we test with hardcoded or switch variables so should not be a factor
Request Type: POST a body
Body content: Custom
Custom body: as shown in the code snips above
Authentication scheme: None
Parameters:
Headers:
Response: Attach as dataset
Dataset name: HTTPResponse
Dataset model: Automatic
Response headers: Discard
Retry after failed connection: No
Ignore server certificate errors: No