GitHub

RDK

Static IP Calls

You can make API calls to outside of Rio from a static IP address.

  • You cannot make more than 3 requests in parallel.
interface StaticIPRequest {
    url: string
    data: {
        requestData?: any
        returnData?: any
        returnEndpoint?: StaticIPCallback
    }
    headers?: Record<string, string>
    method?: StaticIPHttpMethod
    timeout?: number
    sync?: boolean
    auth?: {
        username: string
        password: string
    }
    disableSSL?: boolean
}


interface OperationResponse {
    success: boolean
    data?: any
    error?: string
}


async function request(input: StaticIPRequest): Promise<OperationResponse | undefined> {
    // ...
}


async function httpRequest(input: StaticIPRequest): Promise<OperationResponse | undefined> {
    // ...
}

Usage

import RDK from '@retter/rdk'


const rdk = new RDK()


await rdk.request({ url: 'https://api.ipify.org?format=json', method: 'GET' })
await rdk.httpRequest({ url: 'https://api.ipify.org?format=json', method: 'GET' })


await rdk.pipeline()
    .request({ url: 'https://api.ipify.org?format=json', method: 'GET' })
    .request({ url: 'https://api.ipify.org?format=json', method: 'POST' })
    .httpRequest({ url: 'https://api.ipify.org?format=json', method: 'GET' })
    .httpRequest({ url: 'https://api.ipify.org?format=json', method: 'POST' })
    .send()

API Reference

Static IP Request Input

ParameterTypeRequiredDescription
urlstringtrueURL
data{ requestData?: any; returnData?: any; returnEndpoint?: StaticIPCallback }trueRequest body
methodstringfalseHTTP method
headersRecord<string, string>falseRequest headers
timeoutnumberfalseTimeout
syncbooleanfalseFlag to decide whether to respond synchronously or not
auth{ username: string, password: string }falseBasic authentication parameters
disableSSLbooleanfalseFlag to decide whether to disable SSL verification

Operation Output

ParameterTypeRequiredDescription
successbooleantrueReturns true if operation is successful
dataanyfalseSuccessful response
errorstringfalseReason of failure
Previous
Memory