got#OptionsOfTextResponseBody TypeScript Examples
The following examples show how to use
got#OptionsOfTextResponseBody.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: viera.ts From homebridge-vieramatic with Apache License 2.0 | 6 votes |
#renderRequest = (action: string, urn: string, parameters: string): OptionsOfTextResponseBody => {
const method: OptionsOfTextResponseBody['method'] = 'POST'
const responseType: OptionsOfTextResponseBody['responseType'] = 'text'
const headers = { SOAPACTION: `"urn:${urn}#${action}"` }
const body = '<?xml version="1.0" encoding="utf-8"?>'.concat(
xml({
's:Envelope': {
'@_s:encodingStyle': 'http://schemas.xmlsoap.org/soap/encoding/',
'@_xmlns:s': 'http://schemas.xmlsoap.org/soap/envelope/',
's:Body': { [`u:${action}`]: { '#text': parameters, '@_xmlns:u': `urn:${urn}` } }
}
})
)
return { body, headers, method, responseType }
}
Example #2
Source File: index.test.ts From ens-metadata-service with MIT License | 5 votes |
options: OptionsOfJSONResponseBody | OptionsOfTextResponseBody = { prefixUrl: SERVER_URL.toString(), }