PostMultipartResponseJson
Posts a Form encoded document, expects a Json response.
Service | Operation |
---|---|
httpClient | POST_MULTIPART_RESPONSE_JSON |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var serviceCode = "webService";
var path = "resource/dir";
var query = {
"parmName": "value"
};
var headers = {
"headerName": "value"
};
var formData = [
{
"key": "parm1",
"value": "parm1value",
"valueType": "string"
},
{
"key": "parm2",
"valueType": "userFile",
"cloudPath": "test",
"cloudFilename": "testfile"
}
];
var httpClientProxy = bridge.getHttpClientServiceProxy();
var postResult = httpClientProxy.postMultipartResponseJson(serviceCode, path, query, headers, formData);
if (postResult.status == 200) {
// Success!
}
var serviceCode = "webService";
var path = "resource/dir";
var query = {
"parmName": "value"
};
var headers = {
"headerName": "value"
};
var formData = [
{
"key": "parm1",
"value": "parm1value",
"valueType": "string"
},
{
"key": "parm2",
"valueType": "userFile",
"cloudPath": "test",
"cloudFilename": "testfile"
}
];
var httpClientProxy = bridge.getHttpClientServiceProxy();
var postResult = httpClientProxy.postMultipartResponseJson(serviceCode, path, query, headers, formData);
if (postResult.status == 200) {
// Success!
}
Method Parameters
Parameter | Description |
---|---|
serviceCode | Service code of the external service configured in the Cloud Code - Web Services section of the portal |
path | Path to append to the Base URL of the service |
query | Map of query parameters |
headers | Map of extra headers |
formData | Map of form parameters |