PostTextResponseText
{
"packetId": 1,
"messages": [
{
"service": "httpClient",
"operation": "POST_TEXT_RESPONSE_TEXT",
"data": {
"serviceCode": 1,
"path": "path/to/resource",
"headers": {
"1": "Player Name",
"2": 2235
},
"text": "Text doc"
}
}
]
}
This operation posts a Text document and expects a Text document in response.
Results
Name | Description |
---|---|
response | Text response |
Service | Operation |
---|---|
httpClient | POST_TEXT_RESPONSE_TEXT |
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. |
headers | Optional map of extra headers. |
text | A text document. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var serviceCode = "webService";
var path = "resource/dir";
var headers = {
"headerName": "value"
};
var text = "text string";
var httpClientProxy = bridge.getHttpClientServiceProxy();
var postResult = httpClientProxy.postTextResponseText(serviceCode, path, headers, text);
if (postResult.status == 200) {
// Success!
}
{
"service": "httpClient",
"operation": "POST_TEXT_RESPONSE_TEXT",
"data": {
"serviceCode": "webService",
"path": "resource/dir",
"headers": {
"headerName": "value"
},
"text": "text string"
}
}
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": {
"response": "Text response"
}
}
]
}