@chilkat/react-native 11.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/ChilkatRN.podspec +44 -0
- package/LICENSE +254 -0
- package/README.md +67 -0
- package/android/CMakeLists.txt +60 -0
- package/android/build.gradle +148 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/margelo/nitro/chilkat/ChilkatRNPackage.java +33 -0
- package/chilkat-checksums.json +9 -0
- package/cpp/HybridAi.cpp +660 -0
- package/cpp/HybridAi.hpp +159 -0
- package/cpp/HybridAsn.cpp +403 -0
- package/cpp/HybridAsn.hpp +105 -0
- package/cpp/HybridAuthAws.cpp +188 -0
- package/cpp/HybridAuthAws.hpp +55 -0
- package/cpp/HybridAuthAzureSAS.cpp +142 -0
- package/cpp/HybridAuthAzureSAS.hpp +47 -0
- package/cpp/HybridAuthAzureStorage.cpp +144 -0
- package/cpp/HybridAuthAzureStorage.hpp +47 -0
- package/cpp/HybridAuthGoogle.cpp +215 -0
- package/cpp/HybridAuthGoogle.hpp +67 -0
- package/cpp/HybridBinData.cpp +439 -0
- package/cpp/HybridBinData.hpp +112 -0
- package/cpp/HybridBz2.cpp +177 -0
- package/cpp/HybridBz2.hpp +58 -0
- package/cpp/HybridCache.cpp +314 -0
- package/cpp/HybridCache.hpp +82 -0
- package/cpp/HybridCert.cpp +840 -0
- package/cpp/HybridCert.hpp +196 -0
- package/cpp/HybridCertChain.cpp +149 -0
- package/cpp/HybridCertChain.hpp +50 -0
- package/cpp/HybridCertStore.cpp +276 -0
- package/cpp/HybridCertStore.hpp +78 -0
- package/cpp/HybridCharset.cpp +333 -0
- package/cpp/HybridCharset.hpp +83 -0
- package/cpp/HybridCkDateTime.cpp +384 -0
- package/cpp/HybridCkDateTime.hpp +105 -0
- package/cpp/HybridCodeSign.cpp +156 -0
- package/cpp/HybridCodeSign.hpp +55 -0
- package/cpp/HybridCompression.cpp +422 -0
- package/cpp/HybridCompression.hpp +100 -0
- package/cpp/HybridCrypt2.cpp +1517 -0
- package/cpp/HybridCrypt2.hpp +320 -0
- package/cpp/HybridCsr.cpp +292 -0
- package/cpp/HybridCsr.hpp +77 -0
- package/cpp/HybridCsv.cpp +382 -0
- package/cpp/HybridCsv.hpp +101 -0
- package/cpp/HybridDh.cpp +137 -0
- package/cpp/HybridDh.hpp +47 -0
- package/cpp/HybridDirTree.cpp +167 -0
- package/cpp/HybridDirTree.hpp +53 -0
- package/cpp/HybridDkim.cpp +249 -0
- package/cpp/HybridDkim.hpp +74 -0
- package/cpp/HybridDns.cpp +193 -0
- package/cpp/HybridDns.hpp +64 -0
- package/cpp/HybridDsa.cpp +453 -0
- package/cpp/HybridDsa.hpp +112 -0
- package/cpp/HybridDtObj.cpp +172 -0
- package/cpp/HybridDtObj.hpp +57 -0
- package/cpp/HybridEcc.cpp +195 -0
- package/cpp/HybridEcc.hpp +55 -0
- package/cpp/HybridEdDSA.cpp +147 -0
- package/cpp/HybridEdDSA.hpp +47 -0
- package/cpp/HybridEmail.cpp +1911 -0
- package/cpp/HybridEmail.hpp +419 -0
- package/cpp/HybridEmailBundle.cpp +204 -0
- package/cpp/HybridEmailBundle.hpp +64 -0
- package/cpp/HybridFileAccess.cpp +631 -0
- package/cpp/HybridFileAccess.hpp +149 -0
- package/cpp/HybridFtp2.cpp +2308 -0
- package/cpp/HybridFtp2.hpp +462 -0
- package/cpp/HybridGlobal.cpp +221 -0
- package/cpp/HybridGlobal.hpp +68 -0
- package/cpp/HybridGzip.cpp +440 -0
- package/cpp/HybridGzip.hpp +105 -0
- package/cpp/HybridHashtable.cpp +211 -0
- package/cpp/HybridHashtable.hpp +64 -0
- package/cpp/HybridHtmlToText.cpp +136 -0
- package/cpp/HybridHtmlToText.hpp +47 -0
- package/cpp/HybridHtmlToXml.cpp +218 -0
- package/cpp/HybridHtmlToXml.hpp +65 -0
- package/cpp/HybridHttp.cpp +2067 -0
- package/cpp/HybridHttp.hpp +416 -0
- package/cpp/HybridHttpCurl.cpp +337 -0
- package/cpp/HybridHttpCurl.hpp +93 -0
- package/cpp/HybridHttpRequest.cpp +455 -0
- package/cpp/HybridHttpRequest.hpp +109 -0
- package/cpp/HybridHttpResponse.cpp +340 -0
- package/cpp/HybridHttpResponse.hpp +86 -0
- package/cpp/HybridImap.cpp +1818 -0
- package/cpp/HybridImap.hpp +363 -0
- package/cpp/HybridJavaKeyStore.cpp +387 -0
- package/cpp/HybridJavaKeyStore.hpp +98 -0
- package/cpp/HybridJs.cpp +154 -0
- package/cpp/HybridJs.hpp +54 -0
- package/cpp/HybridJsonArray.cpp +441 -0
- package/cpp/HybridJsonArray.hpp +120 -0
- package/cpp/HybridJsonObject.cpp +1125 -0
- package/cpp/HybridJsonObject.hpp +260 -0
- package/cpp/HybridJwe.cpp +294 -0
- package/cpp/HybridJwe.hpp +82 -0
- package/cpp/HybridJws.cpp +290 -0
- package/cpp/HybridJws.hpp +82 -0
- package/cpp/HybridJwt.cpp +198 -0
- package/cpp/HybridJwt.hpp +57 -0
- package/cpp/HybridLog.cpp +212 -0
- package/cpp/HybridLog.hpp +63 -0
- package/cpp/HybridMailMan.cpp +1853 -0
- package/cpp/HybridMailMan.hpp +386 -0
- package/cpp/HybridMailboxes.cpp +165 -0
- package/cpp/HybridMailboxes.hpp +54 -0
- package/cpp/HybridMcp.cpp +322 -0
- package/cpp/HybridMcp.hpp +85 -0
- package/cpp/HybridMessageSet.cpp +162 -0
- package/cpp/HybridMessageSet.hpp +54 -0
- package/cpp/HybridMht.cpp +700 -0
- package/cpp/HybridMht.hpp +165 -0
- package/cpp/HybridMime.cpp +1119 -0
- package/cpp/HybridMime.hpp +266 -0
- package/cpp/HybridNtlm.cpp +333 -0
- package/cpp/HybridNtlm.hpp +83 -0
- package/cpp/HybridOAuth1.cpp +307 -0
- package/cpp/HybridOAuth1.hpp +78 -0
- package/cpp/HybridOAuth2.cpp +515 -0
- package/cpp/HybridOAuth2.hpp +127 -0
- package/cpp/HybridPdf.cpp +370 -0
- package/cpp/HybridPdf.hpp +103 -0
- package/cpp/HybridPem.cpp +327 -0
- package/cpp/HybridPem.hpp +88 -0
- package/cpp/HybridPfx.cpp +343 -0
- package/cpp/HybridPfx.hpp +87 -0
- package/cpp/HybridPkcs11.cpp +318 -0
- package/cpp/HybridPkcs11.hpp +88 -0
- package/cpp/HybridPrivateKey.cpp +464 -0
- package/cpp/HybridPrivateKey.hpp +117 -0
- package/cpp/HybridPrng.cpp +192 -0
- package/cpp/HybridPrng.hpp +57 -0
- package/cpp/HybridPublicKey.cpp +238 -0
- package/cpp/HybridPublicKey.hpp +68 -0
- package/cpp/HybridRest.cpp +993 -0
- package/cpp/HybridRest.hpp +214 -0
- package/cpp/HybridRsa.cpp +348 -0
- package/cpp/HybridRsa.hpp +90 -0
- package/cpp/HybridSCard.cpp +328 -0
- package/cpp/HybridSCard.hpp +91 -0
- package/cpp/HybridSFtp.cpp +1889 -0
- package/cpp/HybridSFtp.hpp +366 -0
- package/cpp/HybridSFtpDir.cpp +119 -0
- package/cpp/HybridSFtpDir.hpp +43 -0
- package/cpp/HybridSFtpFile.cpp +203 -0
- package/cpp/HybridSFtpFile.hpp +60 -0
- package/cpp/HybridScMinidriver.cpp +341 -0
- package/cpp/HybridScMinidriver.hpp +88 -0
- package/cpp/HybridScp.cpp +398 -0
- package/cpp/HybridScp.hpp +96 -0
- package/cpp/HybridSecrets.cpp +328 -0
- package/cpp/HybridSecrets.hpp +84 -0
- package/cpp/HybridSecureString.cpp +175 -0
- package/cpp/HybridSecureString.hpp +55 -0
- package/cpp/HybridServerSentEvent.cpp +112 -0
- package/cpp/HybridServerSentEvent.hpp +41 -0
- package/cpp/HybridSocket.cpp +1567 -0
- package/cpp/HybridSocket.hpp +336 -0
- package/cpp/HybridSpider.cpp +543 -0
- package/cpp/HybridSpider.hpp +138 -0
- package/cpp/HybridSsh.cpp +1330 -0
- package/cpp/HybridSsh.hpp +282 -0
- package/cpp/HybridSshKey.cpp +310 -0
- package/cpp/HybridSshKey.hpp +83 -0
- package/cpp/HybridSshTunnel.cpp +687 -0
- package/cpp/HybridSshTunnel.hpp +159 -0
- package/cpp/HybridStream.cpp +496 -0
- package/cpp/HybridStream.hpp +123 -0
- package/cpp/HybridStringArray.cpp +368 -0
- package/cpp/HybridStringArray.hpp +99 -0
- package/cpp/HybridStringBuilder.cpp +739 -0
- package/cpp/HybridStringBuilder.hpp +178 -0
- package/cpp/HybridStringTable.cpp +218 -0
- package/cpp/HybridStringTable.hpp +66 -0
- package/cpp/HybridTar.cpp +547 -0
- package/cpp/HybridTar.hpp +134 -0
- package/cpp/HybridTrustedRoots.cpp +178 -0
- package/cpp/HybridTrustedRoots.hpp +61 -0
- package/cpp/HybridUnixCompress.cpp +191 -0
- package/cpp/HybridUnixCompress.hpp +60 -0
- package/cpp/HybridUpload.cpp +427 -0
- package/cpp/HybridUpload.hpp +114 -0
- package/cpp/HybridUrl.cpp +152 -0
- package/cpp/HybridUrl.hpp +48 -0
- package/cpp/HybridWebSocket.cpp +378 -0
- package/cpp/HybridWebSocket.hpp +103 -0
- package/cpp/HybridXml.cpp +1527 -0
- package/cpp/HybridXml.hpp +340 -0
- package/cpp/HybridXmlCertVault.cpp +215 -0
- package/cpp/HybridXmlCertVault.hpp +63 -0
- package/cpp/HybridXmlDSig.cpp +328 -0
- package/cpp/HybridXmlDSig.hpp +88 -0
- package/cpp/HybridXmlDSigGen.cpp +549 -0
- package/cpp/HybridXmlDSigGen.hpp +126 -0
- package/cpp/HybridXmp.cpp +329 -0
- package/cpp/HybridXmp.hpp +86 -0
- package/cpp/HybridZip.cpp +1000 -0
- package/cpp/HybridZip.hpp +226 -0
- package/cpp/HybridZipCrc.cpp +162 -0
- package/cpp/HybridZipCrc.hpp +57 -0
- package/cpp/HybridZipEntry.cpp +395 -0
- package/cpp/HybridZipEntry.hpp +102 -0
- package/cpp/runtime/AsyncCall.hpp +96 -0
- package/cpp/runtime/Bytes.hpp +49 -0
- package/cpp/runtime/ChilkatError.hpp +66 -0
- package/cpp/runtime/ChilkatObject.hpp +219 -0
- package/cpp/runtime/ProgLang.hpp +9 -0
- package/cpp/runtime/ProgressAdapter.hpp +43 -0
- package/nitro.json +113 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/ChilkatRN+autolinking.cmake +179 -0
- package/nitrogen/generated/android/ChilkatRN+autolinking.gradle +27 -0
- package/nitrogen/generated/android/ChilkatRNOnLoad.cpp +1029 -0
- package/nitrogen/generated/android/ChilkatRNOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chilkat/ChilkatRNOnLoad.kt +35 -0
- package/nitrogen/generated/ios/ChilkatRN+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/ChilkatRNAutolinking.mm +1015 -0
- package/nitrogen/generated/ios/ChilkatRNAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridAiSpec.cpp +114 -0
- package/nitrogen/generated/shared/c++/HybridAiSpec.hpp +175 -0
- package/nitrogen/generated/shared/c++/HybridAsnSpec.cpp +70 -0
- package/nitrogen/generated/shared/c++/HybridAsnSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.cpp +49 -0
- package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.hpp +78 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.hpp +81 -0
- package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.cpp +56 -0
- package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.hpp +108 -0
- package/nitrogen/generated/shared/c++/HybridBinDataSpec.cpp +69 -0
- package/nitrogen/generated/shared/c++/HybridBinDataSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridBz2Spec.cpp +47 -0
- package/nitrogen/generated/shared/c++/HybridBz2Spec.hpp +93 -0
- package/nitrogen/generated/shared/c++/HybridCacheSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridCacheSpec.hpp +106 -0
- package/nitrogen/generated/shared/c++/HybridCertChainSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridCertChainSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridCertSpec.cpp +138 -0
- package/nitrogen/generated/shared/c++/HybridCertSpec.hpp +205 -0
- package/nitrogen/generated/shared/c++/HybridCertStoreSpec.cpp +55 -0
- package/nitrogen/generated/shared/c++/HybridCertStoreSpec.hpp +104 -0
- package/nitrogen/generated/shared/c++/HybridCharsetSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridCharsetSpec.hpp +101 -0
- package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.cpp +66 -0
- package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridCodeSignSpec.cpp +44 -0
- package/nitrogen/generated/shared/c++/HybridCodeSignSpec.hpp +93 -0
- package/nitrogen/generated/shared/c++/HybridCompressionSpec.cpp +79 -0
- package/nitrogen/generated/shared/c++/HybridCompressionSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridCrypt2Spec.cpp +215 -0
- package/nitrogen/generated/shared/c++/HybridCrypt2Spec.hpp +283 -0
- package/nitrogen/generated/shared/c++/HybridCsrSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridCsrSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridCsvSpec.cpp +72 -0
- package/nitrogen/generated/shared/c++/HybridCsvSpec.hpp +121 -0
- package/nitrogen/generated/shared/c++/HybridDhSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridDhSpec.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridDirTreeSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridDirTreeSpec.hpp +86 -0
- package/nitrogen/generated/shared/c++/HybridDkimSpec.cpp +60 -0
- package/nitrogen/generated/shared/c++/HybridDkimSpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridDnsSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridDnsSpec.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridDsaSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridDsaSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridDtObjSpec.cpp +50 -0
- package/nitrogen/generated/shared/c++/HybridDtObjSpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/HybridEccSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridEccSpec.hpp +96 -0
- package/nitrogen/generated/shared/c++/HybridEdDSASpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridEdDSASpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridEmailSpec.cpp +259 -0
- package/nitrogen/generated/shared/c++/HybridEmailSpec.hpp +326 -0
- package/nitrogen/generated/shared/c++/HybridFileAccessSpec.cpp +90 -0
- package/nitrogen/generated/shared/c++/HybridFileAccessSpec.hpp +140 -0
- package/nitrogen/generated/shared/c++/HybridFtp2Spec.cpp +367 -0
- package/nitrogen/generated/shared/c++/HybridFtp2Spec.hpp +434 -0
- package/nitrogen/generated/shared/c++/HybridGlobalSpec.cpp +59 -0
- package/nitrogen/generated/shared/c++/HybridGlobalSpec.hpp +99 -0
- package/nitrogen/generated/shared/c++/HybridGzipSpec.cpp +79 -0
- package/nitrogen/generated/shared/c++/HybridGzipSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridHashtableSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridHashtableSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.cpp +49 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.cpp +67 -0
- package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.hpp +125 -0
- package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.hpp +122 -0
- package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.cpp +64 -0
- package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.hpp +119 -0
- package/nitrogen/generated/shared/c++/HybridHttpSpec.cpp +334 -0
- package/nitrogen/generated/shared/c++/HybridHttpSpec.hpp +407 -0
- package/nitrogen/generated/shared/c++/HybridImapSpec.cpp +275 -0
- package/nitrogen/generated/shared/c++/HybridImapSpec.hpp +360 -0
- package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.cpp +65 -0
- package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.hpp +132 -0
- package/nitrogen/generated/shared/c++/HybridJsSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridJsSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridJsonArraySpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridJsonArraySpec.hpp +131 -0
- package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.cpp +154 -0
- package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.hpp +218 -0
- package/nitrogen/generated/shared/c++/HybridJweSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridJweSpec.hpp +112 -0
- package/nitrogen/generated/shared/c++/HybridJwsSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridJwsSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridJwtSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridJwtSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridLogSpec.cpp +44 -0
- package/nitrogen/generated/shared/c++/HybridLogSpec.hpp +85 -0
- package/nitrogen/generated/shared/c++/HybridMailManSpec.cpp +311 -0
- package/nitrogen/generated/shared/c++/HybridMailManSpec.hpp +396 -0
- package/nitrogen/generated/shared/c++/HybridMailboxesSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridMailboxesSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridMcpSpec.cpp +68 -0
- package/nitrogen/generated/shared/c++/HybridMcpSpec.hpp +117 -0
- package/nitrogen/generated/shared/c++/HybridMessageSetSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridMessageSetSpec.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridMhtSpec.cpp +138 -0
- package/nitrogen/generated/shared/c++/HybridMhtSpec.hpp +181 -0
- package/nitrogen/generated/shared/c++/HybridMimeSpec.cpp +169 -0
- package/nitrogen/generated/shared/c++/HybridMimeSpec.hpp +233 -0
- package/nitrogen/generated/shared/c++/HybridNtlmSpec.cpp +69 -0
- package/nitrogen/generated/shared/c++/HybridNtlmSpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridOAuth1Spec.cpp +67 -0
- package/nitrogen/generated/shared/c++/HybridOAuth1Spec.hpp +110 -0
- package/nitrogen/generated/shared/c++/HybridOAuth2Spec.cpp +107 -0
- package/nitrogen/generated/shared/c++/HybridOAuth2Spec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridPdfSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridPdfSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridPemSpec.cpp +63 -0
- package/nitrogen/generated/shared/c++/HybridPemSpec.hpp +124 -0
- package/nitrogen/generated/shared/c++/HybridPfxSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridPfxSpec.hpp +122 -0
- package/nitrogen/generated/shared/c++/HybridPkcs11Spec.cpp +60 -0
- package/nitrogen/generated/shared/c++/HybridPkcs11Spec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.hpp +131 -0
- package/nitrogen/generated/shared/c++/HybridPrngSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridPrngSpec.hpp +85 -0
- package/nitrogen/generated/shared/c++/HybridPublicKeySpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridPublicKeySpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridRestSpec.cpp +150 -0
- package/nitrogen/generated/shared/c++/HybridRestSpec.hpp +229 -0
- package/nitrogen/generated/shared/c++/HybridRsaSpec.cpp +68 -0
- package/nitrogen/generated/shared/c++/HybridRsaSpec.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridSCardSpec.cpp +64 -0
- package/nitrogen/generated/shared/c++/HybridSCardSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.cpp +35 -0
- package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.hpp +78 -0
- package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.hpp +98 -0
- package/nitrogen/generated/shared/c++/HybridSFtpSpec.cpp +284 -0
- package/nitrogen/generated/shared/c++/HybridSFtpSpec.hpp +354 -0
- package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.hpp +119 -0
- package/nitrogen/generated/shared/c++/HybridScpSpec.cpp +78 -0
- package/nitrogen/generated/shared/c++/HybridScpSpec.hpp +127 -0
- package/nitrogen/generated/shared/c++/HybridSecretsSpec.cpp +65 -0
- package/nitrogen/generated/shared/c++/HybridSecretsSpec.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridSecureStringSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridSecureStringSpec.hpp +88 -0
- package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.cpp +35 -0
- package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridSocketSpec.cpp +262 -0
- package/nitrogen/generated/shared/c++/HybridSocketSpec.hpp +327 -0
- package/nitrogen/generated/shared/c++/HybridSpiderSpec.cpp +110 -0
- package/nitrogen/generated/shared/c++/HybridSpiderSpec.hpp +153 -0
- package/nitrogen/generated/shared/c++/HybridSshKeySpec.cpp +59 -0
- package/nitrogen/generated/shared/c++/HybridSshKeySpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/HybridSshSpec.cpp +215 -0
- package/nitrogen/generated/shared/c++/HybridSshSpec.hpp +276 -0
- package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.cpp +136 -0
- package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.hpp +191 -0
- package/nitrogen/generated/shared/c++/HybridStreamSpec.cpp +100 -0
- package/nitrogen/generated/shared/c++/HybridStreamSpec.hpp +150 -0
- package/nitrogen/generated/shared/c++/HybridStringArraySpec.cpp +66 -0
- package/nitrogen/generated/shared/c++/HybridStringArraySpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.cpp +104 -0
- package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridStringTableSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridStringTableSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridTarSpec.cpp +110 -0
- package/nitrogen/generated/shared/c++/HybridTarSpec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridUploadSpec.cpp +98 -0
- package/nitrogen/generated/shared/c++/HybridUploadSpec.hpp +141 -0
- package/nitrogen/generated/shared/c++/HybridUrlSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridUrlSpec.hpp +82 -0
- package/nitrogen/generated/shared/c++/HybridWebSocketSpec.cpp +80 -0
- package/nitrogen/generated/shared/c++/HybridWebSocketSpec.hpp +135 -0
- package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.hpp +94 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.cpp +99 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.hpp +163 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.hpp +126 -0
- package/nitrogen/generated/shared/c++/HybridXmlSpec.cpp +203 -0
- package/nitrogen/generated/shared/c++/HybridXmlSpec.hpp +253 -0
- package/nitrogen/generated/shared/c++/HybridXmpSpec.cpp +58 -0
- package/nitrogen/generated/shared/c++/HybridXmpSpec.hpp +104 -0
- package/nitrogen/generated/shared/c++/HybridZipCrcSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridZipCrcSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridZipEntrySpec.cpp +82 -0
- package/nitrogen/generated/shared/c++/HybridZipEntrySpec.hpp +137 -0
- package/nitrogen/generated/shared/c++/HybridZipSpec.cpp +176 -0
- package/nitrogen/generated/shared/c++/HybridZipSpec.hpp +231 -0
- package/package.json +46 -0
- package/react-native.config.js +9 -0
- package/scripts/fetch-chilkat.js +184 -0
- package/src/index.ts +306 -0
- package/src/runtime/chilkat.ts +25 -0
- package/src/specs/Ai.nitro.ts +1288 -0
- package/src/specs/Asn.nitro.ts +509 -0
- package/src/specs/AuthAws.nitro.ts +234 -0
- package/src/specs/AuthAzureSAS.nitro.ts +205 -0
- package/src/specs/AuthAzureStorage.nitro.ts +172 -0
- package/src/specs/AuthGoogle.nitro.ts +291 -0
- package/src/specs/BinData.nitro.ts +470 -0
- package/src/specs/Bz2.nitro.ts +269 -0
- package/src/specs/Cache.nitro.ts +483 -0
- package/src/specs/Cert.nitro.ts +1279 -0
- package/src/specs/CertChain.nitro.ts +312 -0
- package/src/specs/CertStore.nitro.ts +430 -0
- package/src/specs/Charset.nitro.ts +518 -0
- package/src/specs/CkDateTime.nitro.ts +492 -0
- package/src/specs/CodeSign.nitro.ts +307 -0
- package/src/specs/Compression.nitro.ts +654 -0
- package/src/specs/Crypt2.nitro.ts +2387 -0
- package/src/specs/Csr.nitro.ts +461 -0
- package/src/specs/Csv.nitro.ts +670 -0
- package/src/specs/Dh.nitro.ts +343 -0
- package/src/specs/DirTree.nitro.ts +332 -0
- package/src/specs/Dkim.nitro.ts +595 -0
- package/src/specs/Dns.nitro.ts +271 -0
- package/src/specs/Dsa.nitro.ts +653 -0
- package/src/specs/DtObj.nitro.ts +198 -0
- package/src/specs/Ecc.nitro.ts +375 -0
- package/src/specs/EdDSA.nitro.ts +273 -0
- package/src/specs/Email.nitro.ts +2921 -0
- package/src/specs/EmailBundle.nitro.ts +334 -0
- package/src/specs/FileAccess.nitro.ts +836 -0
- package/src/specs/Ftp2.nitro.ts +3943 -0
- package/src/specs/Global.nitro.ts +319 -0
- package/src/specs/Gzip.nitro.ts +646 -0
- package/src/specs/Hashtable.nitro.ts +356 -0
- package/src/specs/HtmlToText.nitro.ts +238 -0
- package/src/specs/HtmlToXml.nitro.ts +323 -0
- package/src/specs/Http.nitro.ts +3095 -0
- package/src/specs/HttpCurl.nitro.ts +550 -0
- package/src/specs/HttpRequest.nitro.ts +522 -0
- package/src/specs/HttpResponse.nitro.ts +424 -0
- package/src/specs/Imap.nitro.ts +2991 -0
- package/src/specs/JavaKeyStore.nitro.ts +619 -0
- package/src/specs/Js.nitro.ts +263 -0
- package/src/specs/JsonArray.nitro.ts +681 -0
- package/src/specs/JsonObject.nitro.ts +1454 -0
- package/src/specs/Jwe.nitro.ts +756 -0
- package/src/specs/Jws.nitro.ts +733 -0
- package/src/specs/Jwt.nitro.ts +380 -0
- package/src/specs/Log.nitro.ts +258 -0
- package/src/specs/MailMan.nitro.ts +3571 -0
- package/src/specs/Mailboxes.nitro.ts +251 -0
- package/src/specs/Mcp.nitro.ts +491 -0
- package/src/specs/MessageSet.nitro.ts +320 -0
- package/src/specs/Mht.nitro.ts +1684 -0
- package/src/specs/Mime.nitro.ts +1745 -0
- package/src/specs/Ntlm.nitro.ts +556 -0
- package/src/specs/OAuth1.nitro.ts +331 -0
- package/src/specs/OAuth2.nitro.ts +1023 -0
- package/src/specs/Pdf.nitro.ts +740 -0
- package/src/specs/Pem.nitro.ts +484 -0
- package/src/specs/Pfx.nitro.ts +1003 -0
- package/src/specs/Pkcs11.nitro.ts +559 -0
- package/src/specs/PrivateKey.nitro.ts +994 -0
- package/src/specs/Prng.nitro.ts +348 -0
- package/src/specs/PublicKey.nitro.ts +610 -0
- package/src/specs/Rest.nitro.ts +1972 -0
- package/src/specs/Rsa.nitro.ts +453 -0
- package/src/specs/SCard.nitro.ts +739 -0
- package/src/specs/SFtp.nitro.ts +3138 -0
- package/src/specs/SFtpDir.nitro.ts +213 -0
- package/src/specs/SFtpFile.nitro.ts +452 -0
- package/src/specs/ScMinidriver.nitro.ts +443 -0
- package/src/specs/Scp.nitro.ts +708 -0
- package/src/specs/Secrets.nitro.ts +470 -0
- package/src/specs/SecureString.nitro.ts +231 -0
- package/src/specs/ServerSentEvent.nitro.ts +183 -0
- package/src/specs/Socket.nitro.ts +3335 -0
- package/src/specs/Spider.nitro.ts +609 -0
- package/src/specs/Ssh.nitro.ts +2842 -0
- package/src/specs/SshKey.nitro.ts +740 -0
- package/src/specs/SshTunnel.nitro.ts +1243 -0
- package/src/specs/Stream.nitro.ts +737 -0
- package/src/specs/StringArray.nitro.ts +396 -0
- package/src/specs/StringBuilder.nitro.ts +920 -0
- package/src/specs/StringTable.nitro.ts +271 -0
- package/src/specs/Tar.nitro.ts +804 -0
- package/src/specs/TrustedRoots.nitro.ts +360 -0
- package/src/specs/UnixCompress.nitro.ts +293 -0
- package/src/specs/Upload.nitro.ts +623 -0
- package/src/specs/Url.nitro.ts +246 -0
- package/src/specs/WebSocket.nitro.ts +840 -0
- package/src/specs/Xml.nitro.ts +1988 -0
- package/src/specs/XmlCertVault.nitro.ts +259 -0
- package/src/specs/XmlDSig.nitro.ts +464 -0
- package/src/specs/XmlDSigGen.nitro.ts +978 -0
- package/src/specs/Xmp.nitro.ts +364 -0
- package/src/specs/Zip.nitro.ts +1611 -0
- package/src/specs/ZipCrc.nitro.ts +229 -0
- package/src/specs/ZipEntry.nitro.ts +782 -0
|
@@ -0,0 +1,1972 @@
|
|
|
1
|
+
// Generated by ReactNativeNs.RnGenerator -- do not edit.
|
|
2
|
+
import type { HybridObject } from 'react-native-nitro-modules'
|
|
3
|
+
import type { AuthAws } from './AuthAws.nitro'
|
|
4
|
+
import type { AuthAzureSAS } from './AuthAzureSAS.nitro'
|
|
5
|
+
import type { AuthAzureStorage } from './AuthAzureStorage.nitro'
|
|
6
|
+
import type { AuthGoogle } from './AuthGoogle.nitro'
|
|
7
|
+
import type { BinData } from './BinData.nitro'
|
|
8
|
+
import type { JsonObject } from './JsonObject.nitro'
|
|
9
|
+
import type { OAuth1 } from './OAuth1.nitro'
|
|
10
|
+
import type { OAuth2 } from './OAuth2.nitro'
|
|
11
|
+
import type { SecureString } from './SecureString.nitro'
|
|
12
|
+
import type { Socket } from './Socket.nitro'
|
|
13
|
+
import type { Stream } from './Stream.nitro'
|
|
14
|
+
import type { StringBuilder } from './StringBuilder.nitro'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Build, send, authenticate, stream, and inspect REST API requests with precise control.
|
|
18
|
+
*
|
|
19
|
+
* `Rest` is a flexible REST client class for applications
|
|
20
|
+
* that need detailed control over request construction, connection reuse,
|
|
21
|
+
* authentication, headers, query parameters, multipart bodies, streaming
|
|
22
|
+
* uploads and downloads, response parsing, and low-level diagnostics. It is
|
|
23
|
+
* especially useful for APIs where the application must carefully manage
|
|
24
|
+
* provider-specific signing, request paths, body formats, and server responses.
|
|
25
|
+
*
|
|
26
|
+
* **Precise request construction**
|
|
27
|
+
*
|
|
28
|
+
* Build REST requests with explicit paths, headers, query parameters,
|
|
29
|
+
* request bodies, content types, and HTTP methods.
|
|
30
|
+
*
|
|
31
|
+
* **Connection reuse**
|
|
32
|
+
*
|
|
33
|
+
* Connect once and send multiple requests over the same underlying
|
|
34
|
+
* connection when appropriate.
|
|
35
|
+
*
|
|
36
|
+
* **Authentication support**
|
|
37
|
+
*
|
|
38
|
+
* Work with bearer tokens, OAuth2, AWS-style signing, Azure and Google
|
|
39
|
+
* auth helpers, and other service-specific authentication patterns.
|
|
40
|
+
*
|
|
41
|
+
* **Request bodies and multipart**
|
|
42
|
+
*
|
|
43
|
+
* Send JSON, XML, text, binary data, form parameters, multipart requests,
|
|
44
|
+
* streams, and file-based request bodies.
|
|
45
|
+
*
|
|
46
|
+
* **Response handling**
|
|
47
|
+
*
|
|
48
|
+
* Read response bodies as strings, bytes, streams, JSON, XML, or
|
|
49
|
+
* `StringBuilder` content, and inspect status codes and headers.
|
|
50
|
+
*
|
|
51
|
+
* **Diagnostics and debugging**
|
|
52
|
+
*
|
|
53
|
+
* Use detailed error text, raw request generation, response headers,
|
|
54
|
+
* connection state, and verbose diagnostics to troubleshoot API behavior.
|
|
55
|
+
*
|
|
56
|
+
* **Choosing the right class:**
|
|
57
|
+
* Use `Rest` when you want fine-grained control over the
|
|
58
|
+
* connection and request construction. For higher-level HTTP convenience
|
|
59
|
+
* methods that accept full URLs directly, use `Chilkat.Http`. For
|
|
60
|
+
* advanced socket routing, create the connection with `Chilkat.Socket`
|
|
61
|
+
* and pass it to `UseConnection`.
|
|
62
|
+
*
|
|
63
|
+
* **Stateful request configuration:**
|
|
64
|
+
* Request headers, ordinary query parameters, path substitutions, multipart parts,
|
|
65
|
+
* and authentication settings remain associated with the `Rest` object
|
|
66
|
+
* until they are replaced or cleared. When reusing an object for unrelated requests,
|
|
67
|
+
* call the applicable `Clear*` methods rather than assuming request state
|
|
68
|
+
* is automatically reset.
|
|
69
|
+
*
|
|
70
|
+
* **Low-level response workflow:**
|
|
71
|
+
* After a `SendReq*` call, call `ReadResponseHeader` and then read
|
|
72
|
+
* the response body exactly once when a body is present. Fully consume the body before
|
|
73
|
+
* sending another request on the same connection. A `HEAD` response has no
|
|
74
|
+
* body; a `204 No Content` response is represented by an empty body.
|
|
75
|
+
*
|
|
76
|
+
* **Redirects and cookies:**
|
|
77
|
+
* The `Rest` class exposes redirect and response-header information but does
|
|
78
|
+
* not automatically follow redirects or maintain a cookie jar. Applications should
|
|
79
|
+
* process `Location` and `Set-Cookie` values explicitly when needed.
|
|
80
|
+
*
|
|
81
|
+
* For an extended overview, see
|
|
82
|
+
* [Rest Class Overview](https://www.chilkatsoft.com/rest_class_overview.asp).
|
|
83
|
+
*
|
|
84
|
+
* Each `Rest` instance owns a native Chilkat object. It is released when the JavaScript object is
|
|
85
|
+
* garbage collected, or immediately by `dispose()`; any use after `dispose()` throws.
|
|
86
|
+
* Create one with `new Rest()`.
|
|
87
|
+
*
|
|
88
|
+
* Methods that can take a while (network, files, compression, key generation) also have an
|
|
89
|
+
* `...Async` form returning a `Promise`; it runs on a native worker thread so the UI keeps
|
|
90
|
+
* rendering. While such a call is pending, every other call on this object throws, except
|
|
91
|
+
* {@link Rest.abort} and assigning {@link Rest.onPercentDone} / {@link Rest.onProgressInfo}.
|
|
92
|
+
*/
|
|
93
|
+
export interface Rest extends HybridObject<{ ios: 'c++', android: 'c++' }> {
|
|
94
|
+
// ---- Properties ----
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Provides HTML-formatted information about the last called method or property. If a method call
|
|
98
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
99
|
+
* available regardless of the method call's success.
|
|
100
|
+
*
|
|
101
|
+
* This property is read-only.
|
|
102
|
+
*/
|
|
103
|
+
readonly lastErrorHtml: string
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Provides plain text information about the last called method or property. If a method call
|
|
107
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
108
|
+
* available regardless of the method call's success.
|
|
109
|
+
*
|
|
110
|
+
* This property is read-only.
|
|
111
|
+
*/
|
|
112
|
+
readonly lastErrorText: string
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Provides XML-formatted information about the last called method or property. If a method call
|
|
116
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
117
|
+
* available regardless of the method call's success.
|
|
118
|
+
*
|
|
119
|
+
* This property is read-only.
|
|
120
|
+
*/
|
|
121
|
+
readonly lastErrorXml: string
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Version of the component/library, such as "10.1.0"
|
|
125
|
+
*
|
|
126
|
+
* This property is read-only.
|
|
127
|
+
*/
|
|
128
|
+
readonly version: string
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* If set to a file path, this property logs the LastErrorText of each Chilkat method or property
|
|
132
|
+
* call to the specified file. This logging helps identify the context and history of Chilkat
|
|
133
|
+
* calls leading up to any crash or hang, aiding in debugging.
|
|
134
|
+
*
|
|
135
|
+
* Enabling the VerboseLogging property provides more detailed information.
|
|
136
|
+
*
|
|
137
|
+
* This property is mainly used for debugging rare instances where a Chilkat method call causes a
|
|
138
|
+
* hang or crash, which should generally not happen.
|
|
139
|
+
*
|
|
140
|
+
* Possible causes of hangs include:
|
|
141
|
+
*
|
|
142
|
+
* - A timeout property set to 0, indicating an infinite timeout.
|
|
143
|
+
*
|
|
144
|
+
* - A hang occurring within an event callback in the application code.
|
|
145
|
+
*
|
|
146
|
+
* - An internal bug in the Chilkat code causing the hang.
|
|
147
|
+
*/
|
|
148
|
+
debugLogFilePath: string
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* If set to `true`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may
|
|
152
|
+
* contain more verbose information. The default value is `false`. Verbose logging should only be
|
|
153
|
+
* used for debugging. The potentially large quantity of logged information may adversely affect
|
|
154
|
+
* peformance.
|
|
155
|
+
*/
|
|
156
|
+
verboseLogging: boolean
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Indicates the success or failure of the most recent method call: `true` means success, `false`
|
|
160
|
+
* means failure. This property remains unchanged by property setters or getters. This method is
|
|
161
|
+
* present to address challenges in checking for null or Nothing returns in certain programming
|
|
162
|
+
* languages. Note: This property does not apply to methods that return integer values or to
|
|
163
|
+
* boolean-returning methods where the boolean does not indicate success or failure.
|
|
164
|
+
*/
|
|
165
|
+
lastMethodSuccess: boolean
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Gets or sets the value sent in the HTTP `Authorization` request header. Supply only the field
|
|
169
|
+
* value, such as `Bearer eyJ...`, not the text `Authorization:`.
|
|
170
|
+
*
|
|
171
|
+
* **Authentication helpers:** For generated authentication, prefer the appropriate `SetAuth*`
|
|
172
|
+
* method. A configured authentication provider may generate or replace the Authorization header
|
|
173
|
+
* when the request is sent.
|
|
174
|
+
*
|
|
175
|
+
* **Provider precedence:** When a `SetAuth*` provider is active, its generated Authorization
|
|
176
|
+
* header takes precedence over this property and over a manually added Authorization header.
|
|
177
|
+
* {@link Rest.clearAuth} clears both the provider and this value; clearing top-level headers also
|
|
178
|
+
* clears this property.
|
|
179
|
+
*/
|
|
180
|
+
authorization: string
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Controls the interval, in milliseconds, between `AbortCheck` event callbacks during supported
|
|
184
|
+
* long-running operations. The default is `0`, which disables periodic AbortCheck callbacks.
|
|
185
|
+
*
|
|
186
|
+
* **Choosing an interval:** A smaller value makes cancellation more responsive but causes
|
|
187
|
+
* callbacks more frequently.
|
|
188
|
+
*/
|
|
189
|
+
heartbeatMs: number
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Gets or sets the value of the HTTP `Host` request header.
|
|
193
|
+
*
|
|
194
|
+
* **Usually automatic:** For a normal connection, Chilkat derives the Host header from the server
|
|
195
|
+
* established by {@link Rest.connect} or {@link Rest.useConnection}. Set this property explicitly
|
|
196
|
+
* only when the request must present a different virtual-host value.
|
|
197
|
+
*
|
|
198
|
+
* An explicitly assigned value overrides the generated HTTP `Host` field, but it does not change
|
|
199
|
+
* the TCP/TLS destination established by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
200
|
+
*/
|
|
201
|
+
host: string
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Gets or sets the maximum number of milliseconds to wait when a send or receive operation has
|
|
205
|
+
* stopped making progress. The default is `30000` milliseconds.
|
|
206
|
+
*
|
|
207
|
+
* **Not an overall deadline:** This is an inactivity timeout. An operation can run longer than
|
|
208
|
+
* this value as long as data continues to be sent or received.
|
|
209
|
+
*
|
|
210
|
+
* A value of `0` disables the inactivity timeout.
|
|
211
|
+
*/
|
|
212
|
+
idleTimeoutMs: number
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Returns the HTTP header fields from the most recently composed request, excluding the request
|
|
216
|
+
* line. The request line is available separately in {@link Rest.lastRequestStartLine}.
|
|
217
|
+
*
|
|
218
|
+
* **Sensitive data:** The header block may contain credentials, bearer tokens, cookies, or
|
|
219
|
+
* signatures. Avoid writing it to logs unless sensitive values are redacted.
|
|
220
|
+
*
|
|
221
|
+
* A failed {@link Rest.connect} does not clear this value. It continues to describe the last
|
|
222
|
+
* request that was composed and sent.
|
|
223
|
+
*
|
|
224
|
+
* This property is read-only.
|
|
225
|
+
*/
|
|
226
|
+
readonly lastRequestHeader: string
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Returns the request line from the most recently composed request. It contains the HTTP method,
|
|
230
|
+
* request target, and HTTP version, for example:
|
|
231
|
+
*
|
|
232
|
+
* ```
|
|
233
|
+
* GET /v1/items?limit=10 HTTP/1.1
|
|
234
|
+
* ```
|
|
235
|
+
*
|
|
236
|
+
* A failed {@link Rest.connect} does not clear this value. It continues to describe the last
|
|
237
|
+
* request that was composed and sent.
|
|
238
|
+
*
|
|
239
|
+
* This property is read-only.
|
|
240
|
+
*/
|
|
241
|
+
readonly lastRequestStartLine: string
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Returns the number of response header field occurrences. Enumerate them with zero-based indexes
|
|
245
|
+
* using {@link Rest.responseHdrName} and {@link Rest.responseHdrValue}.
|
|
246
|
+
*
|
|
247
|
+
* A failed {@link Rest.connect} does not reset this count; it remains the count for the last
|
|
248
|
+
* received HTTP response.
|
|
249
|
+
*
|
|
250
|
+
* This property is read-only.
|
|
251
|
+
*/
|
|
252
|
+
readonly numResponseHeaders: number
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Selects the multipart entity or part targeted by multipart-building operations such as
|
|
256
|
+
* `AddHeader`, `RemoveHeader`, and the `SetMultipartBody*` methods.
|
|
257
|
+
*
|
|
258
|
+
* ValueSelected target
|
|
259
|
+
*
|
|
260
|
+
* | (empty) | | The top-level request entity |
|
|
261
|
+
*
|
|
262
|
+
* | `0` | | The top-level request entity |
|
|
263
|
+
*
|
|
264
|
+
* | `1` | | The first multipart subpart |
|
|
265
|
+
*
|
|
266
|
+
* | `2` | | The second multipart subpart |
|
|
267
|
+
*
|
|
268
|
+
* | `1.2` | | The second child within the first subpart |
|
|
269
|
+
*
|
|
270
|
+
* **Multipart indexes:** PartSelector uses one-based part numbers, unlike most Chilkat indexed
|
|
271
|
+
* accessors. Reset it to the empty string before modifying top-level request headers.
|
|
272
|
+
*
|
|
273
|
+
* The value `0`, like the empty string, selects the top-level request entity. A nonnumeric
|
|
274
|
+
* selector is invalid. A body assignment can create a higher-numbered part even when
|
|
275
|
+
* lower-numbered parts do not yet exist.
|
|
276
|
+
*/
|
|
277
|
+
partSelector: string
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Returns the HTTP response header fields from the most recently received response, excluding the
|
|
281
|
+
* status line.
|
|
282
|
+
*
|
|
283
|
+
* **Status line:** The numeric status and reason text are available through {@link
|
|
284
|
+
* Rest.responseStatusCode} and {@link Rest.responseStatusText}.
|
|
285
|
+
*
|
|
286
|
+
* Repeated fields remain separate and in received order. The field-name casing is preserved. A
|
|
287
|
+
* failed {@link Rest.connect} does not clear this value; it continues to describe the last
|
|
288
|
+
* received HTTP response.
|
|
289
|
+
*
|
|
290
|
+
* This property is read-only.
|
|
291
|
+
*/
|
|
292
|
+
readonly responseHeader: string
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Returns the numeric HTTP status code from the most recently received response, such as `200`,
|
|
296
|
+
* `404`, or `503`.
|
|
297
|
+
*
|
|
298
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
299
|
+
* still a completed HTTP exchange. Inspect `ResponseStatusCode` and the response body to
|
|
300
|
+
* determine the API-level result.
|
|
301
|
+
*
|
|
302
|
+
* **Last completed exchange:** A failed {@link Rest.connect} does not clear this property. It
|
|
303
|
+
* continues to report the status of the last HTTP response that was actually received.
|
|
304
|
+
*
|
|
305
|
+
* This property is read-only.
|
|
306
|
+
*/
|
|
307
|
+
readonly responseStatusCode: number
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Returns the reason phrase associated with the most recently received HTTP status code, such as
|
|
311
|
+
* `OK` or `Not Found`.
|
|
312
|
+
*
|
|
313
|
+
* **Reason phrases are informational:** Applications should make decisions from the numeric
|
|
314
|
+
* status code. A reason phrase may be empty or may vary by server.
|
|
315
|
+
*
|
|
316
|
+
* **Last completed exchange:** A failed {@link Rest.connect} does not clear this property; it
|
|
317
|
+
* remains associated with the last received HTTP response.
|
|
318
|
+
*
|
|
319
|
+
* This property is read-only.
|
|
320
|
+
*/
|
|
321
|
+
readonly responseStatusText: string
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Controls whether streaming uploads use a `Content-Length` header instead of HTTP/1.1 chunked
|
|
325
|
+
* transfer encoding when the total body size is known. The default is `true`.
|
|
326
|
+
*
|
|
327
|
+
* When `true` and the stream length can be determined—for example, a file stream—Chilkat sends a
|
|
328
|
+
* non-chunked request. When `false`, Chilkat uses `Transfer-Encoding: chunked`. If the stream
|
|
329
|
+
* length is unknown, chunked transfer may still be required.
|
|
330
|
+
*
|
|
331
|
+
* **Server compatibility:** Some HTTP servers and signing schemes require Content-Length and do
|
|
332
|
+
* not accept chunked request bodies; others support either form.
|
|
333
|
+
*/
|
|
334
|
+
streamNonChunked: boolean
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* After {@link Rest.connect} fails, returns a code identifying the connection stage or TLS
|
|
338
|
+
* handshake stage that failed.
|
|
339
|
+
*
|
|
340
|
+
* CodeMeaning
|
|
341
|
+
*
|
|
342
|
+
* | `0` | | Success |
|
|
343
|
+
*
|
|
344
|
+
* | `1` | | Empty hostname |
|
|
345
|
+
*
|
|
346
|
+
* | `2` | | DNS lookup failed |
|
|
347
|
+
*
|
|
348
|
+
* | `3` | | DNS timeout |
|
|
349
|
+
*
|
|
350
|
+
* | `4` | | Aborted by the application |
|
|
351
|
+
*
|
|
352
|
+
* | `5` | | Internal failure |
|
|
353
|
+
*
|
|
354
|
+
* | `6` | | Connection timed out |
|
|
355
|
+
*
|
|
356
|
+
* | `7` | | Connection rejected or otherwise failed |
|
|
357
|
+
*
|
|
358
|
+
* | `99` | | Chilkat is not unlocked or the trial expired |
|
|
359
|
+
*
|
|
360
|
+
* **TLS-related codes:**
|
|
361
|
+
*
|
|
362
|
+
* CodeMeaning
|
|
363
|
+
*
|
|
364
|
+
* | `100` | | TLS internal error |
|
|
365
|
+
*
|
|
366
|
+
* | `101` | | Failed to send ClientHello |
|
|
367
|
+
*
|
|
368
|
+
* | `102` | | Unexpected handshake message |
|
|
369
|
+
*
|
|
370
|
+
* | `103` | | Failed to read ServerHello |
|
|
371
|
+
*
|
|
372
|
+
* | `104` | | No server certificate |
|
|
373
|
+
*
|
|
374
|
+
* | `105` | | Unexpected TLS protocol version |
|
|
375
|
+
*
|
|
376
|
+
* | `106` | | Server certificate verification failed |
|
|
377
|
+
*
|
|
378
|
+
* | `107` | | Unacceptable TLS protocol version |
|
|
379
|
+
*
|
|
380
|
+
* | `109` | | Failed to read handshake messages |
|
|
381
|
+
*
|
|
382
|
+
* | `110` | | Failed to send the client-certificate handshake message |
|
|
383
|
+
*
|
|
384
|
+
* | `111` | | Failed to send ClientKeyExchange |
|
|
385
|
+
*
|
|
386
|
+
* | `112` | | Client certificate private key is inaccessible |
|
|
387
|
+
*
|
|
388
|
+
* | `113` | | Failed to send CertificateVerify |
|
|
389
|
+
*
|
|
390
|
+
* | `114` | | Failed to send ChangeCipherSpec |
|
|
391
|
+
*
|
|
392
|
+
* | `115` | | Failed to send Finished |
|
|
393
|
+
*
|
|
394
|
+
* | `116` | | The server Finished message is invalid |
|
|
395
|
+
*
|
|
396
|
+
* **Detailed diagnostics:** Use the code as a category and inspect `LastErrorText` for the full
|
|
397
|
+
* failure context.
|
|
398
|
+
*
|
|
399
|
+
* **Reset after success:** A successful {@link Rest.connect} resets this property to `0`. HTTP
|
|
400
|
+
* response properties are separate and are not cleared by a later failed connection attempt.
|
|
401
|
+
*
|
|
402
|
+
* This property is read-only.
|
|
403
|
+
*/
|
|
404
|
+
readonly connectFailReason: number
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Applies to the full-request methods that both upload a request and download a response. It
|
|
408
|
+
* selects which direction is represented by percent-complete events.
|
|
409
|
+
*
|
|
410
|
+
* - `false` (default): progress refers to receiving the response body.
|
|
411
|
+
*
|
|
412
|
+
* - `true`: progress refers to sending the request body.
|
|
413
|
+
*
|
|
414
|
+
* **A known total is required:** Percentage can be calculated only when the total byte count is
|
|
415
|
+
* known. For example, a chunked response may not provide a total response length.
|
|
416
|
+
*/
|
|
417
|
+
percentDoneOnSend: boolean
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Controls whether non-ASCII request-header values may be converted to RFC 2047 encoded-word form
|
|
421
|
+
* using Q or Base64 encoding. The default is `true`.
|
|
422
|
+
*
|
|
423
|
+
* Encoded words have forms such as `=?utf-8?Q?...?=` and `=?utf-8?B?...?=`. When this property is
|
|
424
|
+
* `false`, Chilkat does not apply this conversion.
|
|
425
|
+
*
|
|
426
|
+
* **Compatibility feature:** RFC 2047 encoded words originated in Internet message headers. Use
|
|
427
|
+
* this behavior only when the target HTTP service expects it; many APIs instead require ASCII
|
|
428
|
+
* header values or a service-specific encoding.
|
|
429
|
+
*/
|
|
430
|
+
allowHeaderQB: boolean
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Controls whether long request-header fields may be folded onto continuation lines. The default
|
|
434
|
+
* is `false`. When set to `false`, each request header is emitted on a single physical line.
|
|
435
|
+
*
|
|
436
|
+
* **Modern HTTP compatibility:** Obsolete HTTP line folding is rejected by some servers and
|
|
437
|
+
* signing systems. Set this property to `false` when the service requires unfolded header lines,
|
|
438
|
+
* as is common for canonicalized request signatures.
|
|
439
|
+
*/
|
|
440
|
+
allowHeaderFolding: boolean
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Gets or sets the maximum number of milliseconds to wait for the remote server to accept the TCP
|
|
444
|
+
* connection. This timeout covers connection establishment, not the later sending or receiving of
|
|
445
|
+
* HTTP data.
|
|
446
|
+
*
|
|
447
|
+
* **Related timeout:** Use {@link Rest.idleTimeoutMs} to control how long an established
|
|
448
|
+
* operation may remain without send or receive progress.
|
|
449
|
+
*
|
|
450
|
+
* The default is `30000` milliseconds.
|
|
451
|
+
*/
|
|
452
|
+
connectTimeoutMs: number
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* When `true`, calls to the `Send*` and `FullRequest*` methods compose the complete request but
|
|
456
|
+
* do not transmit it. Retrieve the generated request with {@link Rest.getLastDebugRequest}. The
|
|
457
|
+
* default is `false`.
|
|
458
|
+
*
|
|
459
|
+
* **Safe request inspection:** This is useful for validating signing, headers, query strings,
|
|
460
|
+
* multipart formatting, and body encoding without contacting the server. The captured request may
|
|
461
|
+
* contain secrets.
|
|
462
|
+
*
|
|
463
|
+
* In debug mode, a composed full-request call reports a synthetic successful result with
|
|
464
|
+
* `ResponseStatusCode` equal to `201`, `ResponseStatusText` equal to `OK`, and no actual response
|
|
465
|
+
* header or response body.
|
|
466
|
+
*/
|
|
467
|
+
debugMode: boolean
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Provides opt-in compatibility settings for uncommon requirements. The default is the empty
|
|
471
|
+
* string. Supply one or more comma-separated keywords:
|
|
472
|
+
*
|
|
473
|
+
* KeywordEffect
|
|
474
|
+
*
|
|
475
|
+
* | `AllowDuplicateQueryParams` | | Allows `AddQueryParam` to append another parameter having the
|
|
476
|
+
* same name instead of replacing the existing one. |
|
|
477
|
+
*
|
|
478
|
+
* | `AllowInsecureBasicAuth` | | Allows Basic authentication over a non-TLS remote connection. By
|
|
479
|
+
* default, Basic authentication is allowed only over TLS, an SSH tunnel, or localhost. |
|
|
480
|
+
*
|
|
481
|
+
* | `DisableTls13` | | Disables TLS 1.3 so negotiation is limited to TLS 1.2 or earlier supported
|
|
482
|
+
* versions. |
|
|
483
|
+
*
|
|
484
|
+
* | `ProtectFromVpn` | | On Android, attempts to bypass an installed or active VPN for this
|
|
485
|
+
* connection. |
|
|
486
|
+
*
|
|
487
|
+
* **Use sparingly:** Leave this property empty unless a documented interoperability requirement
|
|
488
|
+
* calls for one of these options. In particular, AllowInsecureBasicAuth can expose credentials to
|
|
489
|
+
* network observers.
|
|
490
|
+
*/
|
|
491
|
+
uncommonOptions: string
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Returns the redirect target from the most recently received response. The value comes from the
|
|
495
|
+
* response `Location` header. If the most recent response was not a redirect or did not contain a
|
|
496
|
+
* Location header, this property is empty.
|
|
497
|
+
*
|
|
498
|
+
* **Relative redirects:** A Location value may be an absolute URL or a relative reference,
|
|
499
|
+
* depending on the server response.
|
|
500
|
+
*
|
|
501
|
+
* **Redirect handling:** The value is the response Location field as received. `Rest` does not
|
|
502
|
+
* automatically follow the redirect; send a new request explicitly, reconnecting first if the
|
|
503
|
+
* target host changes.
|
|
504
|
+
*
|
|
505
|
+
* This property is read-only.
|
|
506
|
+
*/
|
|
507
|
+
readonly lastRedirectUrl: string
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Controls automatic resolution of credentials from operating-system secure storage. The default
|
|
511
|
+
* is `false`.
|
|
512
|
+
*
|
|
513
|
+
* When set to `true`, supported credential inputs may contain a secret specification beginning
|
|
514
|
+
* with `!!` instead of a literal secret. Chilkat resolves the specification from Windows
|
|
515
|
+
* Credential Manager on Windows or Apple Keychain on macOS.
|
|
516
|
+
*
|
|
517
|
+
* The specification format is:
|
|
518
|
+
*
|
|
519
|
+
* ```
|
|
520
|
+
* !![appName|]service[|domain]|username
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* For this class, secret specifications apply to the username and password supplied to {@link
|
|
524
|
+
* Rest.setAuthBasic}.
|
|
525
|
+
*
|
|
526
|
+
* **Why use secret resolution:** It avoids embedding long-lived credentials directly in source
|
|
527
|
+
* code, configuration files, command lines, or logs. The requested secret must already exist in
|
|
528
|
+
* the platform credential store.
|
|
529
|
+
*/
|
|
530
|
+
enableSecrets: boolean
|
|
531
|
+
|
|
532
|
+
// ---- Methods ----
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Adds an HTTP request header using `name` as the field name and `value` as the field value. If a
|
|
536
|
+
* request header with the same name is already present for the selected part, its value is
|
|
537
|
+
* replaced.
|
|
538
|
+
*
|
|
539
|
+
* **HTTP header names:** Field names are case-insensitive. Pass only the field name in `name`—for
|
|
540
|
+
* example, `Content-Type`—and not the trailing colon. For multipart requests, {@link
|
|
541
|
+
* Rest.partSelector} determines whether the header is added to the top-level request or to a MIME
|
|
542
|
+
* part.
|
|
543
|
+
*
|
|
544
|
+
* Request headers persist across requests until removed or cleared. Adding the same header again
|
|
545
|
+
* replaces its current value.
|
|
546
|
+
*
|
|
547
|
+
* **Multipart selection:** Header operations apply to the entity selected by {@link
|
|
548
|
+
* Rest.partSelector}. Use an empty selector or `0` for top-level request headers; select a part
|
|
549
|
+
* before adding that part's headers.
|
|
550
|
+
*
|
|
551
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
552
|
+
* {@link Rest.lastErrorText}.
|
|
553
|
+
*/
|
|
554
|
+
addHeader(name: string, value: string): void
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Adds or replaces a query-string parameter using `name` as the parameter name and `value` as its
|
|
558
|
+
* value. The stored query parameters are incorporated into the request target when a request is
|
|
559
|
+
* sent.
|
|
560
|
+
*
|
|
561
|
+
* **Duplicate parameter names:** By default, adding the same name again replaces the existing
|
|
562
|
+
* value. To retain repeated names such as `tag=red&tag=blue`, include `AllowDuplicateQueryParams`
|
|
563
|
+
* in {@link Rest.uncommonOptions}.
|
|
564
|
+
*
|
|
565
|
+
* **Encoding and lifetime:** `name` and `value` are unencoded text. Chilkat percent-encodes the
|
|
566
|
+
* parameter name and value when composing the request target. For example, a space becomes `%20`,
|
|
567
|
+
* a literal plus sign becomes `%2B`, and a literal percent sign becomes `%25`. Existing percent
|
|
568
|
+
* escapes supplied to this method are therefore encoded again. Parameters persist across ordinary
|
|
569
|
+
* requests until removed or cleared.
|
|
570
|
+
*
|
|
571
|
+
* Parameter names are case-sensitive. Adding the same exact name again replaces the existing
|
|
572
|
+
* value unless `AllowDuplicateQueryParams` is enabled in {@link Rest.uncommonOptions}.
|
|
573
|
+
*
|
|
574
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
575
|
+
* {@link Rest.lastErrorText}.
|
|
576
|
+
*/
|
|
577
|
+
addQueryParam(name: string, value: string): void
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Adds multiple query parameters from the query-string text in `queryString`. Use the form
|
|
581
|
+
* `field1=value1&field2=value2&field3=value3`.
|
|
582
|
+
*
|
|
583
|
+
* **Encoding responsibility:** The values in `queryString` must already be percent-encoded as
|
|
584
|
+
* required for a URL query string. Do not include a leading `?`. For individual name/value pairs,
|
|
585
|
+
* {@link Rest.addQueryParam} is usually clearer.
|
|
586
|
+
*
|
|
587
|
+
* The input is parsed as an already URL-encoded query string and then normalized when the request
|
|
588
|
+
* is composed. A plus sign is interpreted as a space and is emitted as `%20`; encoded delimiters
|
|
589
|
+
* such as `%26` remain data; an item without an equals sign is treated as a parameter with an
|
|
590
|
+
* empty value.
|
|
591
|
+
*
|
|
592
|
+
* Parameters added by this method persist across ordinary requests. When ARG2 of a request method
|
|
593
|
+
* already contains a query string, those inline parameters appear first, followed by the
|
|
594
|
+
* parameters stored in the `Rest` object.
|
|
595
|
+
*
|
|
596
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
597
|
+
* {@link Rest.lastErrorText}.
|
|
598
|
+
*/
|
|
599
|
+
addQueryParams(queryString: string): void
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Removes all HTTP request headers previously added to this object.
|
|
603
|
+
*
|
|
604
|
+
* The method clears headers only from the entity selected by {@link Rest.partSelector}. Clearing
|
|
605
|
+
* top-level headers also clears the {@link Rest.authorization} property. Automatically generated
|
|
606
|
+
* fields such as `Host` and `Content-Length` may be added again when the next request is
|
|
607
|
+
* composed.
|
|
608
|
+
*
|
|
609
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
610
|
+
* {@link Rest.lastErrorText}.
|
|
611
|
+
*/
|
|
612
|
+
clearAllHeaders(): void
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Removes all query parameters previously added to this object.
|
|
616
|
+
*
|
|
617
|
+
* This clears the stored query/form parameter collection. It does not remove a query string
|
|
618
|
+
* written directly in the `uriPath` argument of a request method.
|
|
619
|
+
*
|
|
620
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
621
|
+
* {@link Rest.lastErrorText}.
|
|
622
|
+
*/
|
|
623
|
+
clearAllQueryParams(): void
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Clears the response-stream destination previously configured by {@link
|
|
627
|
+
* Rest.setResponseBodyStream}. Subsequent full-request methods return or store the response body
|
|
628
|
+
* normally instead of streaming it to that destination.
|
|
629
|
+
*
|
|
630
|
+
* Clearing the destination does not alter the `Stream` object itself.
|
|
631
|
+
*/
|
|
632
|
+
clearResponseBodyStream(): void
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Establishes the initial TCP connection to the REST server. `hostname` is a DNS hostname or an
|
|
636
|
+
* IPv4/IPv6 address, `port` is the server port, and `tls` specifies whether the connection uses
|
|
637
|
+
* TLS. Common combinations are port `80` with `tls` set to `false`, and port `443` with `tls` set
|
|
638
|
+
* to `true`.
|
|
639
|
+
*
|
|
640
|
+
* If `autoReconnect` is `true`, subsequent requests may automatically reconnect when the existing
|
|
641
|
+
* connection is no longer usable. If `autoReconnect` is `false`, a lost connection causes the
|
|
642
|
+
* request to fail until the application explicitly reconnects.
|
|
643
|
+
*
|
|
644
|
+
* **Hostname only:** `hostname` is not a URL. For `https://api.example.com/v1/items`, pass
|
|
645
|
+
* `api.example.com`. The request path is supplied separately to the request method.
|
|
646
|
+
*
|
|
647
|
+
* **Advanced connections:** `Connect` is intended for a direct connection. For HTTP or SOCKS
|
|
648
|
+
* proxies, SSH tunneling, client certificates, custom socket routing, or other advanced
|
|
649
|
+
* connection setup, establish a connected `Socket` and pass it to {@link Rest.useConnection}.
|
|
650
|
+
*
|
|
651
|
+
* **Reconnect behavior:** When `autoReconnect` is `true`, Chilkat can establish a new connection
|
|
652
|
+
* before a later request after the previous connection has closed. This option should not be
|
|
653
|
+
* interpreted as a promise to replay a request that failed after transmission began.
|
|
654
|
+
*
|
|
655
|
+
* **Result-state behavior:** A successful connection resets {@link Rest.connectFailReason} to
|
|
656
|
+
* `0`. A failed `Connect` does not clear the HTTP response and last-request properties from an
|
|
657
|
+
* earlier completed exchange; those properties continue to describe the last HTTP
|
|
658
|
+
* request/response, not the failed connection attempt.
|
|
659
|
+
*
|
|
660
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
661
|
+
* {@link Rest.connectAsync}.
|
|
662
|
+
*
|
|
663
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
664
|
+
* {@link Rest.lastErrorText}.
|
|
665
|
+
*/
|
|
666
|
+
connect(hostname: string, port: number, tls: boolean, autoReconnect: boolean): void
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Asynchronous form of {@link Rest.connect}: the same call on a native worker thread,
|
|
670
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
671
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
672
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
673
|
+
*
|
|
674
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
675
|
+
* {@link Rest.lastErrorText}.
|
|
676
|
+
*/
|
|
677
|
+
connectAsync(hostname: string, port: number, tls: boolean, autoReconnect: boolean): Promise<void>
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Closes the current HTTP connection, if one is open. `maxWaitMs` is the maximum number of
|
|
681
|
+
* milliseconds to wait while attempting a clean shutdown.
|
|
682
|
+
*
|
|
683
|
+
* **Tunneled connections:** When the REST connection uses an SSH tunnel, this closes the logical
|
|
684
|
+
* channel used by REST. It does not close the underlying SSH session itself.
|
|
685
|
+
*
|
|
686
|
+
* **Socket supplied by UseConnection:** When the transport was supplied through {@link
|
|
687
|
+
* Rest.useConnection}, calling `Disconnect` also disconnects that `Socket`. If automatic
|
|
688
|
+
* reconnection was enabled, a later request may reconnect it.
|
|
689
|
+
*
|
|
690
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
691
|
+
* {@link Rest.disconnectAsync}.
|
|
692
|
+
*
|
|
693
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
694
|
+
* {@link Rest.lastErrorText}.
|
|
695
|
+
*/
|
|
696
|
+
disconnect(maxWaitMs: number): void
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Asynchronous form of {@link Rest.disconnect}: the same call on a native worker thread,
|
|
700
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
701
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
702
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
703
|
+
*
|
|
704
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
705
|
+
* {@link Rest.lastErrorText}.
|
|
706
|
+
*/
|
|
707
|
+
disconnectAsync(maxWaitMs: number): Promise<void>
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Sends a complete `application/x-www-form-urlencoded` request. The form body is built from the
|
|
711
|
+
* parameters previously added with {@link Rest.addQueryParam} or {@link Rest.addQueryParams}. The
|
|
712
|
+
* request Content-Type is set to `application/x-www-form-urlencoded`. The response body is read
|
|
713
|
+
* as text and returned.
|
|
714
|
+
*
|
|
715
|
+
* This convenience method performs the equivalent of {@link Rest.sendReqFormUrlEncoded}, {@link
|
|
716
|
+
* Rest.readResponseHeader}, and {@link Rest.readRespBodyString} in sequence.
|
|
717
|
+
*
|
|
718
|
+
* For full-request methods, {@link Rest.percentDoneOnSend} selects whether percent-complete
|
|
719
|
+
* events refer to sending the request body or receiving the response body.
|
|
720
|
+
*
|
|
721
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
722
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
723
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
724
|
+
*
|
|
725
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
726
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
727
|
+
* to determine the API-level result.
|
|
728
|
+
*
|
|
729
|
+
* Parameters written directly in `uriPath` remain in the URL query string. Parameters stored
|
|
730
|
+
* through {@link Rest.addQueryParam}, {@link Rest.addQueryParamSb}, or {@link
|
|
731
|
+
* Rest.addQueryParams} are encoded into the form body. After the form request is sent, this
|
|
732
|
+
* stored parameter collection is cleared.
|
|
733
|
+
*
|
|
734
|
+
* **Persistent Content-Type:** The method sets the top-level `Content-Type` to
|
|
735
|
+
* `application/x-www-form-urlencoded`. That request-header value remains configured for later
|
|
736
|
+
* requests until it is replaced or cleared.
|
|
737
|
+
*
|
|
738
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
739
|
+
* {@link Rest.fullRequestFormUrlEncodedAsync}.
|
|
740
|
+
*
|
|
741
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
742
|
+
* {@link Rest.lastErrorText}.
|
|
743
|
+
*/
|
|
744
|
+
fullRequestFormUrlEncoded(httpVerb: string, uriPath: string): string
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Asynchronous form of {@link Rest.fullRequestFormUrlEncoded}: the same call on a native worker
|
|
748
|
+
* thread,
|
|
749
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
750
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
751
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
752
|
+
*
|
|
753
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
754
|
+
* {@link Rest.lastErrorText}.
|
|
755
|
+
*/
|
|
756
|
+
fullRequestFormUrlEncodedAsync(httpVerb: string, uriPath: string): Promise<string>
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Sends a complete multipart request using the parts and part headers configured through {@link
|
|
760
|
+
* Rest.partSelector}, {@link Rest.addHeader}, and the multipart-body methods. The response body
|
|
761
|
+
* is read as text and returned.
|
|
762
|
+
*
|
|
763
|
+
* This convenience method performs the equivalent of {@link Rest.sendReqMultipart}, {@link
|
|
764
|
+
* Rest.readResponseHeader}, and {@link Rest.readRespBodyString} in sequence.
|
|
765
|
+
*
|
|
766
|
+
* For full-request methods, {@link Rest.percentDoneOnSend} selects whether percent-complete
|
|
767
|
+
* events refer to sending the request body or receiving the response body.
|
|
768
|
+
*
|
|
769
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
770
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
771
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
772
|
+
*
|
|
773
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
774
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
775
|
+
* to determine the API-level result.
|
|
776
|
+
*
|
|
777
|
+
* **Multipart state:** Assigning a body to a selected part creates that part. Parts may be
|
|
778
|
+
* created out of numeric order, persist across multipart requests, and retain the generated
|
|
779
|
+
* boundary while the multipart structure remains configured. The default top-level media type is
|
|
780
|
+
* `multipart/form-data`.
|
|
781
|
+
*
|
|
782
|
+
* The request fails if no multipart subparts are configured.
|
|
783
|
+
*
|
|
784
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
785
|
+
* {@link Rest.fullRequestMultipartAsync}.
|
|
786
|
+
*
|
|
787
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
788
|
+
* {@link Rest.lastErrorText}.
|
|
789
|
+
*/
|
|
790
|
+
fullRequestMultipart(httpVerb: string, uriPath: string): string
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Asynchronous form of {@link Rest.fullRequestMultipart}: the same call on a native worker
|
|
794
|
+
* thread,
|
|
795
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
796
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
797
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
798
|
+
*
|
|
799
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
800
|
+
* {@link Rest.lastErrorText}.
|
|
801
|
+
*/
|
|
802
|
+
fullRequestMultipartAsync(httpVerb: string, uriPath: string): Promise<string>
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Sends a complete request with no request body. The response body is read as text and returned.
|
|
806
|
+
*
|
|
807
|
+
* This convenience method performs the equivalent of {@link Rest.sendReqNoBody}, {@link
|
|
808
|
+
* Rest.readResponseHeader}, and {@link Rest.readRespBodyString} in sequence.
|
|
809
|
+
*
|
|
810
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
811
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
812
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
813
|
+
*
|
|
814
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
815
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
816
|
+
* to determine the API-level result.
|
|
817
|
+
*
|
|
818
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
819
|
+
* {@link Rest.fullRequestNoBodyAsync}.
|
|
820
|
+
*
|
|
821
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
822
|
+
* {@link Rest.lastErrorText}.
|
|
823
|
+
*/
|
|
824
|
+
fullRequestNoBody(httpVerb: string, uriPath: string): string
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Asynchronous form of {@link Rest.fullRequestNoBody}: the same call on a native worker thread,
|
|
828
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
829
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
830
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
831
|
+
*
|
|
832
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
833
|
+
* {@link Rest.lastErrorText}.
|
|
834
|
+
*/
|
|
835
|
+
fullRequestNoBodyAsync(httpVerb: string, uriPath: string): Promise<string>
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Sends a complete request whose body is read from the `Stream` in `stream`. Streaming is
|
|
839
|
+
* appropriate for large uploads because the entire request body need not be held in memory. The
|
|
840
|
+
* response body is read as text and returned.
|
|
841
|
+
*
|
|
842
|
+
* This convenience method performs the equivalent of {@link Rest.sendReqStreamBody}, {@link
|
|
843
|
+
* Rest.readResponseHeader}, and {@link Rest.readRespBodyString} in sequence.
|
|
844
|
+
*
|
|
845
|
+
* For full-request methods, {@link Rest.percentDoneOnSend} selects whether percent-complete
|
|
846
|
+
* events refer to sending the request body or receiving the response body.
|
|
847
|
+
*
|
|
848
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
849
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
850
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
851
|
+
*
|
|
852
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
853
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
854
|
+
* to determine the API-level result.
|
|
855
|
+
*
|
|
856
|
+
* **Stream position:** The stream is read from its current position and is left consumed. Reusing
|
|
857
|
+
* the same stream without resetting its source or position sends only the unread remainder, which
|
|
858
|
+
* may be zero bytes.
|
|
859
|
+
*
|
|
860
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
861
|
+
* {@link Rest.fullRequestStreamAsync}.
|
|
862
|
+
*
|
|
863
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
864
|
+
* {@link Rest.lastErrorText}.
|
|
865
|
+
*/
|
|
866
|
+
fullRequestStream(httpVerb: string, uriPath: string, stream: Stream): string
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Asynchronous form of {@link Rest.fullRequestStream}: the same call on a native worker thread,
|
|
870
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
871
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
872
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
873
|
+
*
|
|
874
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
875
|
+
* {@link Rest.lastErrorText}.
|
|
876
|
+
*/
|
|
877
|
+
fullRequestStreamAsync(httpVerb: string, uriPath: string, stream: Stream): Promise<string>
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Sends a complete request whose text body is supplied in `bodyText`, such as JSON, XML, or plain
|
|
881
|
+
* text. The response body is read as text and returned.
|
|
882
|
+
*
|
|
883
|
+
* This convenience method performs the equivalent of {@link Rest.sendReqStringBody}, {@link
|
|
884
|
+
* Rest.readResponseHeader}, and {@link Rest.readRespBodyString} in sequence.
|
|
885
|
+
*
|
|
886
|
+
* For full-request methods, {@link Rest.percentDoneOnSend} selects whether percent-complete
|
|
887
|
+
* events refer to sending the request body or receiving the response body.
|
|
888
|
+
*
|
|
889
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
890
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
891
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
892
|
+
*
|
|
893
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
894
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
895
|
+
* to determine the API-level result.
|
|
896
|
+
*
|
|
897
|
+
* **Text encoding and Content-Type:** Unicode text is encoded as UTF-8. Generic string-body
|
|
898
|
+
* methods do not automatically add a `Content-Type` header; add the media type required by the
|
|
899
|
+
* API, such as `application/json; charset=utf-8`.
|
|
900
|
+
*
|
|
901
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
902
|
+
* {@link Rest.fullRequestStringAsync}.
|
|
903
|
+
*
|
|
904
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
905
|
+
* {@link Rest.lastErrorText}.
|
|
906
|
+
*/
|
|
907
|
+
fullRequestString(httpVerb: string, uriPath: string, bodyText: string): string
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Asynchronous form of {@link Rest.fullRequestString}: the same call on a native worker thread,
|
|
911
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
912
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
913
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
914
|
+
*
|
|
915
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
916
|
+
* {@link Rest.lastErrorText}.
|
|
917
|
+
*/
|
|
918
|
+
fullRequestStringAsync(httpVerb: string, uriPath: string, bodyText: string): Promise<string>
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Reads the response body into the `Stream` supplied in `stream`. Call this after {@link
|
|
922
|
+
* Rest.readResponseHeader}.
|
|
923
|
+
*
|
|
924
|
+
* If `autoSetStreamCharset` is `true` and the response is textual, the stream's `StringCharset`
|
|
925
|
+
* is set from the `charset` parameter in the response `Content-Type` header when one is present.
|
|
926
|
+
* `autoSetStreamCharset` has no effect for binary responses.
|
|
927
|
+
*
|
|
928
|
+
* **Large downloads:** A stream can write directly to a file or another destination, avoiding the
|
|
929
|
+
* need to buffer the entire response body in memory.
|
|
930
|
+
*
|
|
931
|
+
* **Read once:** A response body may be consumed by only one body-reading method. A second
|
|
932
|
+
* attempt fails immediately. Fully consume the body before sending another request on the same
|
|
933
|
+
* connection; otherwise unread bytes can prevent the next response header from being parsed
|
|
934
|
+
* correctly.
|
|
935
|
+
*
|
|
936
|
+
* **Responses without a body:** Do not call a body-reading method for a `HEAD` response. A `204
|
|
937
|
+
* No Content` response is handled as a successful empty body.
|
|
938
|
+
*
|
|
939
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
940
|
+
* {@link Rest.readRespBodyStreamAsync}.
|
|
941
|
+
*
|
|
942
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
943
|
+
* {@link Rest.lastErrorText}.
|
|
944
|
+
*/
|
|
945
|
+
readRespBodyStream(stream: Stream, autoSetStreamCharset: boolean): void
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Asynchronous form of {@link Rest.readRespBodyStream}: the same call on a native worker thread,
|
|
949
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
950
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
951
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
952
|
+
*
|
|
953
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
954
|
+
* {@link Rest.lastErrorText}.
|
|
955
|
+
*/
|
|
956
|
+
readRespBodyStreamAsync(stream: Stream, autoSetStreamCharset: boolean): Promise<void>
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Reads the response body as text and returns it. Call this only after {@link
|
|
960
|
+
* Rest.readResponseHeader} has returned the response status code.
|
|
961
|
+
*
|
|
962
|
+
* **Text versus binary:** Use this method for JSON, XML, HTML, and other textual responses. Use
|
|
963
|
+
* {@link Rest.readRespBd} or {@link Rest.readRespBodyStream} for binary or very large content.
|
|
964
|
+
*
|
|
965
|
+
* **Read once:** A response body may be consumed by only one body-reading method. A second
|
|
966
|
+
* attempt fails immediately. Fully consume the body before sending another request on the same
|
|
967
|
+
* connection; otherwise unread bytes can prevent the next response header from being parsed
|
|
968
|
+
* correctly.
|
|
969
|
+
*
|
|
970
|
+
* **Responses without a body:** Do not call a body-reading method for a `HEAD` response. A `204
|
|
971
|
+
* No Content` response is handled as a successful empty body.
|
|
972
|
+
*
|
|
973
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
974
|
+
* {@link Rest.readRespBodyStringAsync}.
|
|
975
|
+
*
|
|
976
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
977
|
+
* {@link Rest.lastErrorText}.
|
|
978
|
+
*/
|
|
979
|
+
readRespBodyString(): string
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Asynchronous form of {@link Rest.readRespBodyString}: the same call on a native worker thread,
|
|
983
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
984
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
985
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
986
|
+
*
|
|
987
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
988
|
+
* {@link Rest.lastErrorText}.
|
|
989
|
+
*/
|
|
990
|
+
readRespBodyStringAsync(): Promise<string>
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Reads the HTTP response status line and header fields. The returned integer is the HTTP status
|
|
994
|
+
* code, such as `200`, `404`, or `500`. A return value of `-1` means that no HTTP response was
|
|
995
|
+
* received because a transport or protocol error occurred.
|
|
996
|
+
*
|
|
997
|
+
* After this method returns a status code, inspect {@link Rest.responseHeader}, {@link
|
|
998
|
+
* Rest.responseStatusCode}, {@link Rest.responseStatusText}, and the response-header access
|
|
999
|
+
* methods. If the response has a body, read it with {@link Rest.readRespBodyString}, {@link
|
|
1000
|
+
* Rest.readRespBd}, {@link Rest.readRespBodyStream}, or another appropriate body-reading method.
|
|
1001
|
+
*
|
|
1002
|
+
* **Do not infer body presence from the request method alone:** Whether a response body is
|
|
1003
|
+
* present depends on the response status, request method, and response headers. For example, a
|
|
1004
|
+
* GET commonly has a response body, while HEAD does not.
|
|
1005
|
+
*
|
|
1006
|
+
* **Read once:** A response body may be consumed by only one body-reading method. A second
|
|
1007
|
+
* attempt fails immediately. Fully consume the body before sending another request on the same
|
|
1008
|
+
* connection; otherwise unread bytes can prevent the next response header from being parsed
|
|
1009
|
+
* correctly.
|
|
1010
|
+
*
|
|
1011
|
+
* **Responses without a body:** Do not call a body-reading method for a `HEAD` response. A `204
|
|
1012
|
+
* No Content` response is handled as a successful empty body.
|
|
1013
|
+
*
|
|
1014
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1015
|
+
* {@link Rest.readResponseHeaderAsync}.
|
|
1016
|
+
*/
|
|
1017
|
+
readResponseHeader(): number
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Asynchronous form of {@link Rest.readResponseHeader}: the same call on a native worker thread,
|
|
1021
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1022
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1023
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1024
|
+
*/
|
|
1025
|
+
readResponseHeaderAsync(): Promise<number>
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Removes all request headers named by `name` from the request level selected by {@link
|
|
1029
|
+
* Rest.partSelector}.
|
|
1030
|
+
*
|
|
1031
|
+
* Header-name matching is case-insensitive, and all matching occurrences are removed.
|
|
1032
|
+
*
|
|
1033
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1034
|
+
* {@link Rest.lastErrorText}.
|
|
1035
|
+
*/
|
|
1036
|
+
removeHeader(name: string): void
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Removes all query parameters whose name matches `name`.
|
|
1040
|
+
*
|
|
1041
|
+
* Parameter-name matching is case-sensitive. All parameters having the exact name are removed. A
|
|
1042
|
+
* `true` return value indicates that the operation completed successfully; it does not guarantee
|
|
1043
|
+
* that a matching parameter existed.
|
|
1044
|
+
*
|
|
1045
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1046
|
+
* {@link Rest.lastErrorText}.
|
|
1047
|
+
*/
|
|
1048
|
+
removeQueryParam(name: string): void
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Returns the value of the response header field named by `name`. HTTP header field names are
|
|
1052
|
+
* case-insensitive.
|
|
1053
|
+
*
|
|
1054
|
+
* **Repeated response headers:** When the response can contain repeated fields, use {@link
|
|
1055
|
+
* Rest.numResponseHeaders}, {@link Rest.responseHdrName}, and {@link Rest.responseHdrValue} to
|
|
1056
|
+
* enumerate every field occurrence.
|
|
1057
|
+
*
|
|
1058
|
+
* If the response contains the same field more than once, this method returns the first matching
|
|
1059
|
+
* value. Enumerate the header collection to obtain all occurrences, especially for fields such as
|
|
1060
|
+
* `Set-Cookie`.
|
|
1061
|
+
*
|
|
1062
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1063
|
+
* {@link Rest.lastErrorText}.
|
|
1064
|
+
*/
|
|
1065
|
+
responseHdrByName(name: string): string
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Returns the field name of the response header at zero-based index `index`. Valid indexes range
|
|
1069
|
+
* from `0` through {@link Rest.numResponseHeaders} minus one.
|
|
1070
|
+
*
|
|
1071
|
+
* Enumeration preserves the response-field order and the field-name casing received from the
|
|
1072
|
+
* server. Repeated fields occupy separate indexes.
|
|
1073
|
+
*
|
|
1074
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1075
|
+
* {@link Rest.lastErrorText}.
|
|
1076
|
+
*/
|
|
1077
|
+
responseHdrName(index: number): string
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Returns the field value of the response header at zero-based index `index`. Use the same index
|
|
1081
|
+
* with {@link Rest.responseHdrName} to obtain the corresponding field name.
|
|
1082
|
+
*
|
|
1083
|
+
* Repeated response fields occupy separate indexes and are returned in received order.
|
|
1084
|
+
*
|
|
1085
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1086
|
+
* {@link Rest.lastErrorText}.
|
|
1087
|
+
*/
|
|
1088
|
+
responseHdrValue(index: number): string
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Sends an `application/x-www-form-urlencoded` request. The request body is built from the
|
|
1092
|
+
* parameters added with {@link Rest.addQueryParam} or {@link Rest.addQueryParams}. Any manually
|
|
1093
|
+
* supplied `Content-Type` value is replaced with `application/x-www-form-urlencoded`.
|
|
1094
|
+
*
|
|
1095
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1096
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1097
|
+
* then read the response body with the appropriate response method.
|
|
1098
|
+
*
|
|
1099
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1100
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1101
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1102
|
+
*
|
|
1103
|
+
* Parameters written directly in `uriPath` remain in the URL query string. Parameters stored
|
|
1104
|
+
* through {@link Rest.addQueryParam}, {@link Rest.addQueryParamSb}, or {@link
|
|
1105
|
+
* Rest.addQueryParams} are encoded into the form body. After the form request is sent, this
|
|
1106
|
+
* stored parameter collection is cleared.
|
|
1107
|
+
*
|
|
1108
|
+
* **Persistent Content-Type:** The method sets the top-level `Content-Type` to
|
|
1109
|
+
* `application/x-www-form-urlencoded`. That request-header value remains configured for later
|
|
1110
|
+
* requests until it is replaced or cleared.
|
|
1111
|
+
*
|
|
1112
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1113
|
+
* {@link Rest.sendReqFormUrlEncodedAsync}.
|
|
1114
|
+
*
|
|
1115
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1116
|
+
* {@link Rest.lastErrorText}.
|
|
1117
|
+
*/
|
|
1118
|
+
sendReqFormUrlEncoded(httpVerb: string, uriPath: string): void
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Asynchronous form of {@link Rest.sendReqFormUrlEncoded}: the same call on a native worker
|
|
1122
|
+
* thread,
|
|
1123
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1124
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1125
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1126
|
+
*
|
|
1127
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1128
|
+
* {@link Rest.lastErrorText}.
|
|
1129
|
+
*/
|
|
1130
|
+
sendReqFormUrlEncodedAsync(httpVerb: string, uriPath: string): Promise<void>
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Sends a multipart request using the parts configured with {@link Rest.partSelector}, {@link
|
|
1134
|
+
* Rest.addHeader}, and the multipart-body methods.
|
|
1135
|
+
*
|
|
1136
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1137
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1138
|
+
* then read the response body with the appropriate response method.
|
|
1139
|
+
*
|
|
1140
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1141
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1142
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1143
|
+
*
|
|
1144
|
+
* **Multipart state:** Assigning a body to a selected part creates that part. Parts may be
|
|
1145
|
+
* created out of numeric order, persist across multipart requests, and retain the generated
|
|
1146
|
+
* boundary while the multipart structure remains configured. The default top-level media type is
|
|
1147
|
+
* `multipart/form-data`.
|
|
1148
|
+
*
|
|
1149
|
+
* The request fails if no multipart subparts are configured.
|
|
1150
|
+
*
|
|
1151
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1152
|
+
* {@link Rest.sendReqMultipartAsync}.
|
|
1153
|
+
*
|
|
1154
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1155
|
+
* {@link Rest.lastErrorText}.
|
|
1156
|
+
*/
|
|
1157
|
+
sendReqMultipart(httpVerb: string, uriPath: string): void
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Asynchronous form of {@link Rest.sendReqMultipart}: the same call on a native worker thread,
|
|
1161
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1162
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1163
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1164
|
+
*
|
|
1165
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1166
|
+
* {@link Rest.lastErrorText}.
|
|
1167
|
+
*/
|
|
1168
|
+
sendReqMultipartAsync(httpVerb: string, uriPath: string): Promise<void>
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Sends a request without a request body.
|
|
1172
|
+
*
|
|
1173
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1174
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1175
|
+
* then read the response body with the appropriate response method.
|
|
1176
|
+
*
|
|
1177
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1178
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1179
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1180
|
+
*
|
|
1181
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1182
|
+
* {@link Rest.sendReqNoBodyAsync}.
|
|
1183
|
+
*
|
|
1184
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1185
|
+
* {@link Rest.lastErrorText}.
|
|
1186
|
+
*/
|
|
1187
|
+
sendReqNoBody(httpVerb: string, uriPath: string): void
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Asynchronous form of {@link Rest.sendReqNoBody}: the same call on a native worker thread,
|
|
1191
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1192
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1193
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1194
|
+
*
|
|
1195
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1196
|
+
* {@link Rest.lastErrorText}.
|
|
1197
|
+
*/
|
|
1198
|
+
sendReqNoBodyAsync(httpVerb: string, uriPath: string): Promise<void>
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Sends a request whose body is read from the `Stream` in `stream`. The stream may supply text or
|
|
1202
|
+
* binary data; set the request `Content-Type` header as required by the API.
|
|
1203
|
+
*
|
|
1204
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1205
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1206
|
+
* then read the response body with the appropriate response method.
|
|
1207
|
+
*
|
|
1208
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1209
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1210
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1211
|
+
*
|
|
1212
|
+
* **Streaming:** The stream is consumed while the request is sent, which is useful when the body
|
|
1213
|
+
* is too large to hold in memory.
|
|
1214
|
+
*
|
|
1215
|
+
* **Stream position:** The stream is read from its current position and is left consumed. Reusing
|
|
1216
|
+
* the same stream without resetting its source or position sends only the unread remainder, which
|
|
1217
|
+
* may be zero bytes.
|
|
1218
|
+
*
|
|
1219
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1220
|
+
* {@link Rest.sendReqStreamBodyAsync}.
|
|
1221
|
+
*
|
|
1222
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1223
|
+
* {@link Rest.lastErrorText}.
|
|
1224
|
+
*/
|
|
1225
|
+
sendReqStreamBody(httpVerb: string, uriPath: string, stream: Stream): void
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Asynchronous form of {@link Rest.sendReqStreamBody}: the same call on a native worker thread,
|
|
1229
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1230
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1231
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1232
|
+
*
|
|
1233
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1234
|
+
* {@link Rest.lastErrorText}.
|
|
1235
|
+
*/
|
|
1236
|
+
sendReqStreamBodyAsync(httpVerb: string, uriPath: string, stream: Stream): Promise<void>
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Sends a request whose text body is supplied in `bodyText`, such as JSON, XML, form-independent
|
|
1240
|
+
* text, or another textual representation. Set the request `Content-Type` header to identify the
|
|
1241
|
+
* body format expected by the server.
|
|
1242
|
+
*
|
|
1243
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1244
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1245
|
+
* then read the response body with the appropriate response method.
|
|
1246
|
+
*
|
|
1247
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1248
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1249
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1250
|
+
*
|
|
1251
|
+
* **Text encoding and Content-Type:** Unicode text is encoded as UTF-8. Generic string-body
|
|
1252
|
+
* methods do not automatically add a `Content-Type` header; add the media type required by the
|
|
1253
|
+
* API, such as `application/json; charset=utf-8`.
|
|
1254
|
+
*
|
|
1255
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1256
|
+
* {@link Rest.sendReqStringBodyAsync}.
|
|
1257
|
+
*
|
|
1258
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1259
|
+
* {@link Rest.lastErrorText}.
|
|
1260
|
+
*/
|
|
1261
|
+
sendReqStringBody(httpVerb: string, uriPath: string, bodyText: string): void
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Asynchronous form of {@link Rest.sendReqStringBody}: the same call on a native worker thread,
|
|
1265
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1266
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1267
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1268
|
+
*
|
|
1269
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1270
|
+
* {@link Rest.lastErrorText}.
|
|
1271
|
+
*/
|
|
1272
|
+
sendReqStringBodyAsync(httpVerb: string, uriPath: string, bodyText: string): Promise<void>
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* Associates the `AuthAws` provider in `authProvider` with this REST object. Chilkat uses the
|
|
1276
|
+
* provider to sign each AWS request after the request method, path, query parameters, headers,
|
|
1277
|
+
* and body are known. The application does not need to construct the `Authorization` header
|
|
1278
|
+
* manually.
|
|
1279
|
+
*
|
|
1280
|
+
* **Request signing:** AWS signatures cover selected request components. Add all required headers
|
|
1281
|
+
* and query parameters before sending the request so the generated signature matches the final
|
|
1282
|
+
* request.
|
|
1283
|
+
*
|
|
1284
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1285
|
+
* {@link Rest.lastErrorText}.
|
|
1286
|
+
*/
|
|
1287
|
+
setAuthAws(authProvider: AuthAws): void
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Associates the `AuthAzureStorage` provider in `authProvider` with this REST object. Chilkat
|
|
1291
|
+
* automatically applies the Azure Storage authorization information required for each request.
|
|
1292
|
+
*
|
|
1293
|
+
* **Azure Storage authentication:** The provider contains the storage account credentials and
|
|
1294
|
+
* signing settings. Request-specific headers and the resource path are incorporated when the
|
|
1295
|
+
* request is sent.
|
|
1296
|
+
*
|
|
1297
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1298
|
+
* {@link Rest.lastErrorText}.
|
|
1299
|
+
*/
|
|
1300
|
+
setAuthAzureStorage(authProvider: AuthAzureStorage): void
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Configures HTTP Basic authentication using `username` as the username and `password` as the
|
|
1304
|
+
* password. Chilkat automatically generates an `Authorization: Basic ...` header for subsequent
|
|
1305
|
+
* requests.
|
|
1306
|
+
*
|
|
1307
|
+
* **Security requirement:** Basic authentication is an encoding scheme, not encryption. Use it
|
|
1308
|
+
* only over TLS. By default, Chilkat blocks Basic authentication on an insecure remote
|
|
1309
|
+
* connection; `AllowInsecureBasicAuth` in {@link Rest.uncommonOptions} exists only for
|
|
1310
|
+
* exceptional compatibility needs.
|
|
1311
|
+
*
|
|
1312
|
+
* Some APIs use an account ID, client ID, API key, token, or secret in place of a traditional
|
|
1313
|
+
* username or password; follow the service documentation.
|
|
1314
|
+
*
|
|
1315
|
+
* **Authorization precedence:** The Basic authentication provider generates the `Authorization`
|
|
1316
|
+
* header when each request is composed and takes precedence over a value set through the {@link
|
|
1317
|
+
* Rest.authorization} property or {@link Rest.addHeader}.
|
|
1318
|
+
*
|
|
1319
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1320
|
+
* {@link Rest.lastErrorText}.
|
|
1321
|
+
*/
|
|
1322
|
+
setAuthBasic(username: string, password: string): void
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Associates the `AuthGoogle` provider in `authProvider` with this REST object. Chilkat uses the
|
|
1326
|
+
* provider to add the Google authentication information needed by subsequent API requests.
|
|
1327
|
+
*
|
|
1328
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1329
|
+
* {@link Rest.lastErrorText}.
|
|
1330
|
+
*/
|
|
1331
|
+
setAuthGoogle(authProvider: AuthGoogle): void
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Associates the `OAuth1` provider in `authProvider` with this REST object for OAuth 1.0 or OAuth
|
|
1335
|
+
* 1.0a request signing.
|
|
1336
|
+
*
|
|
1337
|
+
* If `useQueryParams` is `true`, the OAuth parameters and signature are placed in the query
|
|
1338
|
+
* string. If `useQueryParams` is `false`, they are placed in the `Authorization` header.
|
|
1339
|
+
*
|
|
1340
|
+
* **Final request matters:** OAuth 1 signatures depend on the HTTP method, request URL, and
|
|
1341
|
+
* parameters. Configure the request completely before sending it.
|
|
1342
|
+
*
|
|
1343
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1344
|
+
* {@link Rest.lastErrorText}.
|
|
1345
|
+
*/
|
|
1346
|
+
setAuthOAuth1(authProvider: OAuth1, useQueryParams: boolean): void
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Associates the `OAuth2` provider in `authProvider` with this REST object. The provider must
|
|
1350
|
+
* contain a valid access token. Chilkat then adds an `Authorization: Bearer <access-token>`
|
|
1351
|
+
* header to each request.
|
|
1352
|
+
*
|
|
1353
|
+
* The access token may be obtained through an OAuth flow or loaded from previously saved token
|
|
1354
|
+
* data. Token acquisition, refresh, expiration, and scope requirements are determined by the
|
|
1355
|
+
* authorization server.
|
|
1356
|
+
*
|
|
1357
|
+
* **Manual bearer headers:** A bearer token can also be supplied with {@link Rest.addHeader}. Do
|
|
1358
|
+
* not configure both approaches for the same request because they compete for the same
|
|
1359
|
+
* `Authorization` header.
|
|
1360
|
+
*
|
|
1361
|
+
* **Provider lifetime:** The `OAuth2` object is consulted when each request is composed rather
|
|
1362
|
+
* than copied at setup time. Keep it alive while the `Rest` object uses it. Changing its
|
|
1363
|
+
* `AccessToken` changes the bearer token used by subsequent requests.
|
|
1364
|
+
*
|
|
1365
|
+
* **Authorization precedence:** The provider-generated bearer header takes precedence over a
|
|
1366
|
+
* manually configured `Authorization` value.
|
|
1367
|
+
*
|
|
1368
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1369
|
+
* {@link Rest.lastErrorText}.
|
|
1370
|
+
*/
|
|
1371
|
+
setAuthOAuth2(authProvider: OAuth2): void
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Uses the `Stream` in `stream` as the body source for the multipart part identified by {@link
|
|
1375
|
+
* Rest.partSelector}.
|
|
1376
|
+
*
|
|
1377
|
+
* **Large multipart parts:** The stream is read while the request is sent, allowing a large file
|
|
1378
|
+
* or generated body to be uploaded without first loading the entire part into memory.
|
|
1379
|
+
*
|
|
1380
|
+
* **Object lifetime and position:** The selected part retains the stream as its body source until
|
|
1381
|
+
* the multipart request is sent or the parts are cleared. Keep the `Stream` object alive. It is
|
|
1382
|
+
* read from its current position and must be reset before reusing it for another upload.
|
|
1383
|
+
*
|
|
1384
|
+
* Setting the body creates the selected part when it does not already exist. Part numbers do not
|
|
1385
|
+
* need to be created consecutively.
|
|
1386
|
+
*
|
|
1387
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1388
|
+
* {@link Rest.lastErrorText}.
|
|
1389
|
+
*/
|
|
1390
|
+
setMultipartBodyStream(stream: Stream): void
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* Sets the text body of the multipart part identified by {@link Rest.partSelector} to `bodyText`.
|
|
1394
|
+
*
|
|
1395
|
+
* **Part metadata:** Use {@link Rest.addHeader} while the part is selected to set its
|
|
1396
|
+
* `Content-Type`, `Content-Disposition`, and other part headers.
|
|
1397
|
+
*
|
|
1398
|
+
* Setting the body creates the selected part when it does not already exist. Part numbers do not
|
|
1399
|
+
* need to be created consecutively.
|
|
1400
|
+
*
|
|
1401
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1402
|
+
* {@link Rest.lastErrorText}.
|
|
1403
|
+
*/
|
|
1404
|
+
setMultipartBodyString(bodyText: string): void
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Configures a `Stream` destination for response bodies received by the full-request convenience
|
|
1408
|
+
* methods. The body is written to `responseStream` only when the response status code matches
|
|
1409
|
+
* `expectedStatus`.
|
|
1410
|
+
*
|
|
1411
|
+
* If streaming occurs successfully, a string-returning full-request method returns `OK`. If
|
|
1412
|
+
* streaming was selected but writing the body fails, it returns `FAIL`. If the status code does
|
|
1413
|
+
* not match `expectedStatus`, the body is not streamed and remains available as the method's
|
|
1414
|
+
* normal response text.
|
|
1415
|
+
*
|
|
1416
|
+
* If `autoSetStreamCharset` is `true` and the response is textual, the destination stream's
|
|
1417
|
+
* `StringCharset` is set from the response `Content-Type` charset when available.
|
|
1418
|
+
* `autoSetStreamCharset` is ignored for binary responses.
|
|
1419
|
+
*
|
|
1420
|
+
* `expectedStatus` valueStatus codes that are streamed
|
|
1421
|
+
*
|
|
1422
|
+
* | `200` | | Only `200` |
|
|
1423
|
+
*
|
|
1424
|
+
* | `-200` | | `200` through `299` |
|
|
1425
|
+
*
|
|
1426
|
+
* | `-210` | | `210` through `219` |
|
|
1427
|
+
*
|
|
1428
|
+
* **Resetting this behavior:** Call {@link Rest.clearResponseBodyStream} to restore normal
|
|
1429
|
+
* response-body handling.
|
|
1430
|
+
*
|
|
1431
|
+
* For Boolean-returning full-request methods, successful streaming returns `true`. A
|
|
1432
|
+
* `StringBuilder` response output receives `OK`; a `BinData` response output is cleared. If the
|
|
1433
|
+
* status does not match `expectedStatus`, the stream is not written and the method returns the
|
|
1434
|
+
* response through its normal output.
|
|
1435
|
+
*
|
|
1436
|
+
* The configuration remains active for later full-request calls until {@link
|
|
1437
|
+
* Rest.clearResponseBodyStream} is called.
|
|
1438
|
+
*
|
|
1439
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1440
|
+
* {@link Rest.lastErrorText}.
|
|
1441
|
+
*/
|
|
1442
|
+
setResponseBodyStream(expectedStatus: number, autoSetStreamCharset: boolean, responseStream: Stream): void
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Uses the already-connected `Socket` in `connection` as the transport for REST requests. The
|
|
1446
|
+
* socket may represent a direct TCP or TLS connection, an HTTP or SOCKS proxy connection, an
|
|
1447
|
+
* SSH-tunneled channel, or another connection configured through the Socket API.
|
|
1448
|
+
*
|
|
1449
|
+
* `autoReconnect` controls automatic reconnection for later requests when the connection is no
|
|
1450
|
+
* longer usable.
|
|
1451
|
+
*
|
|
1452
|
+
* **When to use this method:** Use {@link Rest.connect} for ordinary direct connections. Use
|
|
1453
|
+
* `UseConnection` when the connection requires advanced Socket configuration.
|
|
1454
|
+
*
|
|
1455
|
+
* **Socket lifetime:** The `Rest` object retains and operates on the supplied `Socket`. Keep the
|
|
1456
|
+
* Socket object alive while it is attached. Calling {@link Rest.disconnect} disconnects it; with
|
|
1457
|
+
* `autoReconnect` set to `true`, a later request can reconnect the same Socket object.
|
|
1458
|
+
*
|
|
1459
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1460
|
+
* {@link Rest.lastErrorText}.
|
|
1461
|
+
*/
|
|
1462
|
+
useConnection(connection: Socket, autoReconnect: boolean): void
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Sends a complete request whose text body is read from the `StringBuilder` in `requestBody`. The
|
|
1466
|
+
* text response body replaces the existing contents of the `StringBuilder` in `responseBody`.
|
|
1467
|
+
*
|
|
1468
|
+
* This is the `StringBuilder` form of {@link Rest.fullRequestString}.
|
|
1469
|
+
*
|
|
1470
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1471
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1472
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1473
|
+
*
|
|
1474
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
1475
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
1476
|
+
* to determine the API-level result.
|
|
1477
|
+
*
|
|
1478
|
+
* **Text encoding and Content-Type:** Unicode text is encoded as UTF-8. Generic string-body
|
|
1479
|
+
* methods do not automatically add a `Content-Type` header; add the media type required by the
|
|
1480
|
+
* API, such as `application/json; charset=utf-8`.
|
|
1481
|
+
*
|
|
1482
|
+
* `responseBody` is cleared and replaced with the response body.
|
|
1483
|
+
*
|
|
1484
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1485
|
+
* {@link Rest.fullRequestSbAsync}.
|
|
1486
|
+
*
|
|
1487
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1488
|
+
* {@link Rest.lastErrorText}.
|
|
1489
|
+
*/
|
|
1490
|
+
fullRequestSb(httpVerb: string, uriPath: string, requestBody: StringBuilder, responseBody: StringBuilder): void
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Asynchronous form of {@link Rest.fullRequestSb}: the same call on a native worker thread,
|
|
1494
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1495
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1496
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1497
|
+
*
|
|
1498
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1499
|
+
* {@link Rest.lastErrorText}.
|
|
1500
|
+
*/
|
|
1501
|
+
fullRequestSbAsync(httpVerb: string, uriPath: string, requestBody: StringBuilder, responseBody: StringBuilder): Promise<void>
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* Adds or replaces a query-string parameter named by `name`. The parameter value is read from the
|
|
1505
|
+
* `StringBuilder` in `value`.
|
|
1506
|
+
*
|
|
1507
|
+
* **Duplicate parameter names:** By default, the same name is replaced. Include
|
|
1508
|
+
* `AllowDuplicateQueryParams` in {@link Rest.uncommonOptions} to retain repeated names.
|
|
1509
|
+
*
|
|
1510
|
+
* **Encoding and lifetime:** `name` and the text in `value` are unencoded text. Chilkat
|
|
1511
|
+
* percent-encodes the parameter name and value when composing the request target. For example, a
|
|
1512
|
+
* space becomes `%20`, a literal plus sign becomes `%2B`, and a literal percent sign becomes
|
|
1513
|
+
* `%25`. Existing percent escapes supplied to this method are therefore encoded again. Parameters
|
|
1514
|
+
* persist across ordinary requests until removed or cleared.
|
|
1515
|
+
*
|
|
1516
|
+
* Parameter names are case-sensitive. Adding the same exact name again replaces the existing
|
|
1517
|
+
* value unless `AllowDuplicateQueryParams` is enabled in {@link Rest.uncommonOptions}.
|
|
1518
|
+
*
|
|
1519
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1520
|
+
* {@link Rest.lastErrorText}.
|
|
1521
|
+
*/
|
|
1522
|
+
addQueryParamSb(name: string, value: StringBuilder): void
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Sets the text body of the multipart part identified by {@link Rest.partSelector} from the
|
|
1526
|
+
* `StringBuilder` in `bodySb`.
|
|
1527
|
+
*
|
|
1528
|
+
* Setting the body creates the selected part when it does not already exist. Part numbers do not
|
|
1529
|
+
* need to be created consecutively.
|
|
1530
|
+
*
|
|
1531
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1532
|
+
* {@link Rest.lastErrorText}.
|
|
1533
|
+
*/
|
|
1534
|
+
setMultipartBodySb(bodySb: StringBuilder): void
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Sets the binary body of the multipart part identified by {@link Rest.partSelector} from the
|
|
1538
|
+
* `BinData` in `bodyData`.
|
|
1539
|
+
*
|
|
1540
|
+
* Setting the body creates the selected part when it does not already exist. Part numbers do not
|
|
1541
|
+
* need to be created consecutively.
|
|
1542
|
+
*
|
|
1543
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1544
|
+
* {@link Rest.lastErrorText}.
|
|
1545
|
+
*/
|
|
1546
|
+
setMultipartBodyBd(bodyData: BinData): void
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Sends a request whose text body is read from the `StringBuilder` in `bodySb`. Set the request
|
|
1550
|
+
* `Content-Type` header to identify the body format.
|
|
1551
|
+
*
|
|
1552
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1553
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1554
|
+
* then read the response body with the appropriate response method.
|
|
1555
|
+
*
|
|
1556
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1557
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1558
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1559
|
+
*
|
|
1560
|
+
* **Text encoding and Content-Type:** Unicode text is encoded as UTF-8. Generic string-body
|
|
1561
|
+
* methods do not automatically add a `Content-Type` header; add the media type required by the
|
|
1562
|
+
* API, such as `application/json; charset=utf-8`.
|
|
1563
|
+
*
|
|
1564
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1565
|
+
* {@link Rest.sendReqSbAsync}.
|
|
1566
|
+
*
|
|
1567
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1568
|
+
* {@link Rest.lastErrorText}.
|
|
1569
|
+
*/
|
|
1570
|
+
sendReqSb(httpVerb: string, uriPath: string, bodySb: StringBuilder): void
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Asynchronous form of {@link Rest.sendReqSb}: the same call on a native worker thread,
|
|
1574
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1575
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1576
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1577
|
+
*
|
|
1578
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1579
|
+
* {@link Rest.lastErrorText}.
|
|
1580
|
+
*/
|
|
1581
|
+
sendReqSbAsync(httpVerb: string, uriPath: string, bodySb: StringBuilder): Promise<void>
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* Sends a request whose binary body is read from the `BinData` in `body`.
|
|
1585
|
+
*
|
|
1586
|
+
* `httpVerb` is the HTTP method, such as `GET`, `POST`, or `PUT`. `uriPath` is the request path.
|
|
1587
|
+
* This is a low-level send operation: after it succeeds, call {@link Rest.readResponseHeader} and
|
|
1588
|
+
* then read the response body with the appropriate response method.
|
|
1589
|
+
*
|
|
1590
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1591
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1592
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1593
|
+
*
|
|
1594
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1595
|
+
* {@link Rest.sendReqBdAsync}.
|
|
1596
|
+
*
|
|
1597
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1598
|
+
* {@link Rest.lastErrorText}.
|
|
1599
|
+
*/
|
|
1600
|
+
sendReqBd(httpVerb: string, uriPath: string, body: BinData): void
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* Asynchronous form of {@link Rest.sendReqBd}: the same call on a native worker thread,
|
|
1604
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1605
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1606
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1607
|
+
*
|
|
1608
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1609
|
+
* {@link Rest.lastErrorText}.
|
|
1610
|
+
*/
|
|
1611
|
+
sendReqBdAsync(httpVerb: string, uriPath: string, body: BinData): Promise<void>
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Reads the response body as text into the `StringBuilder` in `responseBody`, replacing its
|
|
1615
|
+
* previous contents. Call this after {@link Rest.readResponseHeader}.
|
|
1616
|
+
*
|
|
1617
|
+
* **Read once:** A response body may be consumed by only one body-reading method. A second
|
|
1618
|
+
* attempt fails immediately. Fully consume the body before sending another request on the same
|
|
1619
|
+
* connection; otherwise unread bytes can prevent the next response header from being parsed
|
|
1620
|
+
* correctly.
|
|
1621
|
+
*
|
|
1622
|
+
* **Responses without a body:** Do not call a body-reading method for a `HEAD` response. A `204
|
|
1623
|
+
* No Content` response is handled as a successful empty body.
|
|
1624
|
+
*
|
|
1625
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1626
|
+
* {@link Rest.readRespSbAsync}.
|
|
1627
|
+
*
|
|
1628
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1629
|
+
* {@link Rest.lastErrorText}.
|
|
1630
|
+
*/
|
|
1631
|
+
readRespSb(responseBody: StringBuilder): void
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Asynchronous form of {@link Rest.readRespSb}: the same call on a native worker thread,
|
|
1635
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1636
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1637
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1638
|
+
*
|
|
1639
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1640
|
+
* {@link Rest.lastErrorText}.
|
|
1641
|
+
*/
|
|
1642
|
+
readRespSbAsync(responseBody: StringBuilder): Promise<void>
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* Reads the response body as raw bytes into the `BinData` in `responseBody`, replacing its
|
|
1646
|
+
* previous contents. Call this after {@link Rest.readResponseHeader}.
|
|
1647
|
+
*
|
|
1648
|
+
* **Use for binary content:** Typical examples include images, archives, PDFs, encrypted data,
|
|
1649
|
+
* and arbitrary file downloads.
|
|
1650
|
+
*
|
|
1651
|
+
* **Read once:** A response body may be consumed by only one body-reading method. A second
|
|
1652
|
+
* attempt fails immediately. Fully consume the body before sending another request on the same
|
|
1653
|
+
* connection; otherwise unread bytes can prevent the next response header from being parsed
|
|
1654
|
+
* correctly.
|
|
1655
|
+
*
|
|
1656
|
+
* **Responses without a body:** Do not call a body-reading method for a `HEAD` response. A `204
|
|
1657
|
+
* No Content` response is handled as a successful empty body.
|
|
1658
|
+
*
|
|
1659
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1660
|
+
* {@link Rest.readRespBdAsync}.
|
|
1661
|
+
*
|
|
1662
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1663
|
+
* {@link Rest.lastErrorText}.
|
|
1664
|
+
*/
|
|
1665
|
+
readRespBd(responseBody: BinData): void
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* Asynchronous form of {@link Rest.readRespBd}: the same call on a native worker thread,
|
|
1669
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1670
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1671
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1672
|
+
*
|
|
1673
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1674
|
+
* {@link Rest.lastErrorText}.
|
|
1675
|
+
*/
|
|
1676
|
+
readRespBdAsync(responseBody: BinData): Promise<void>
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Removes all multipart subparts from the request under construction. This is useful when reusing
|
|
1680
|
+
* the same REST object after sending a multipart request.
|
|
1681
|
+
*
|
|
1682
|
+
* **Scope:** This clears multipart parts; it does not by itself clear query parameters, path
|
|
1683
|
+
* parameters, authentication settings, or ordinary top-level request headers.
|
|
1684
|
+
*
|
|
1685
|
+
* This also resets {@link Rest.partSelector} to the empty string and releases the configured
|
|
1686
|
+
* multipart bodies and part streams.
|
|
1687
|
+
*
|
|
1688
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1689
|
+
* {@link Rest.lastErrorText}.
|
|
1690
|
+
*/
|
|
1691
|
+
clearAllParts(): void
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Sends a complete request without a request body and stores the text response body in the
|
|
1695
|
+
* `StringBuilder` in `sb`, replacing its previous contents.
|
|
1696
|
+
*
|
|
1697
|
+
* This is the `StringBuilder` form of {@link Rest.fullRequestNoBody}.
|
|
1698
|
+
*
|
|
1699
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1700
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1701
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1702
|
+
*
|
|
1703
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
1704
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
1705
|
+
* to determine the API-level result.
|
|
1706
|
+
*
|
|
1707
|
+
* `sb` is cleared and replaced with the textual response body.
|
|
1708
|
+
*
|
|
1709
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1710
|
+
* {@link Rest.fullRequestNoBodySbAsync}.
|
|
1711
|
+
*
|
|
1712
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1713
|
+
* {@link Rest.lastErrorText}.
|
|
1714
|
+
*/
|
|
1715
|
+
fullRequestNoBodySb(httpVerb: string, uriPath: string, sb: StringBuilder): void
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Asynchronous form of {@link Rest.fullRequestNoBodySb}: the same call on a native worker thread,
|
|
1719
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1720
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1721
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1722
|
+
*
|
|
1723
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1724
|
+
* {@link Rest.lastErrorText}.
|
|
1725
|
+
*/
|
|
1726
|
+
fullRequestNoBodySbAsync(httpVerb: string, uriPath: string, sb: StringBuilder): Promise<void>
|
|
1727
|
+
|
|
1728
|
+
/**
|
|
1729
|
+
* Sends a complete request whose binary body is read from the `BinData` in `binData`. The text
|
|
1730
|
+
* response body replaces the existing contents of the `StringBuilder` in `responseBody`.
|
|
1731
|
+
*
|
|
1732
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1733
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1734
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1735
|
+
*
|
|
1736
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
1737
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
1738
|
+
* to determine the API-level result.
|
|
1739
|
+
*
|
|
1740
|
+
* `responseBody` is cleared and replaced with the textual response body.
|
|
1741
|
+
*
|
|
1742
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1743
|
+
* {@link Rest.fullRequestBdAsync}.
|
|
1744
|
+
*
|
|
1745
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1746
|
+
* {@link Rest.lastErrorText}.
|
|
1747
|
+
*/
|
|
1748
|
+
fullRequestBd(httpVerb: string, uriPath: string, binData: BinData, responseBody: StringBuilder): void
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Asynchronous form of {@link Rest.fullRequestBd}: the same call on a native worker thread,
|
|
1752
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1753
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1754
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1755
|
+
*
|
|
1756
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1757
|
+
* {@link Rest.lastErrorText}.
|
|
1758
|
+
*/
|
|
1759
|
+
fullRequestBdAsync(httpVerb: string, uriPath: string, binData: BinData, responseBody: StringBuilder): Promise<void>
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* Sends a complete request without a request body and stores the binary response body in the
|
|
1763
|
+
* `BinData` in `binData`, replacing its previous contents.
|
|
1764
|
+
*
|
|
1765
|
+
* **Request path:** `uriPath` is the path and optional query portion of the URL, not a complete
|
|
1766
|
+
* URL. For `https://api.example.com/v1/items?limit=10`, pass `/v1/items?limit=10`. The server
|
|
1767
|
+
* name and port are established separately by {@link Rest.connect} or {@link Rest.useConnection}.
|
|
1768
|
+
*
|
|
1769
|
+
* **HTTP status versus method success:** Receiving an HTTP error status such as `400` or `404` is
|
|
1770
|
+
* still a completed HTTP exchange. Inspect {@link Rest.responseStatusCode} and the response body
|
|
1771
|
+
* to determine the API-level result.
|
|
1772
|
+
*
|
|
1773
|
+
* `binData` is cleared and replaced with the binary response body.
|
|
1774
|
+
*
|
|
1775
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1776
|
+
* {@link Rest.fullRequestNoBodyBdAsync}.
|
|
1777
|
+
*
|
|
1778
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1779
|
+
* {@link Rest.lastErrorText}.
|
|
1780
|
+
*/
|
|
1781
|
+
fullRequestNoBodyBd(httpVerb: string, uriPath: string, binData: BinData): void
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* Asynchronous form of {@link Rest.fullRequestNoBodyBd}: the same call on a native worker thread,
|
|
1785
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1786
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1787
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1788
|
+
*
|
|
1789
|
+
* The promise rejects with an Error if the call fails; the full log is in
|
|
1790
|
+
* {@link Rest.lastErrorText}.
|
|
1791
|
+
*/
|
|
1792
|
+
fullRequestNoBodyBdAsync(httpVerb: string, uriPath: string, binData: BinData): Promise<void>
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* Associates the `AuthAzureSAS` provider in `authProvider` with this REST object. Chilkat
|
|
1796
|
+
* automatically adds an `Authorization: SharedAccessSignature ...` header to subsequent requests.
|
|
1797
|
+
*
|
|
1798
|
+
* **SAS terminology:** This method is for Azure services that use a Shared Access Signature in
|
|
1799
|
+
* the Authorization header. It is distinct from a storage SAS token embedded in a URL query
|
|
1800
|
+
* string.
|
|
1801
|
+
*
|
|
1802
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1803
|
+
* {@link Rest.lastErrorText}.
|
|
1804
|
+
*/
|
|
1805
|
+
setAuthAzureSas(authProvider: AuthAzureSAS): void
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* Computes the Amazon Marketplace Web Service (MWS) request signature using the secret key in
|
|
1809
|
+
* `mwsSecretKey` and adds or replaces the `Signature` query parameter. Call this after all other
|
|
1810
|
+
* MWS request parameters have been added.
|
|
1811
|
+
*
|
|
1812
|
+
* `httpVerb` is the HTTP method, `uriPath` is the MWS resource path, and `domain` is the request
|
|
1813
|
+
* domain. `httpVerb` and `uriPath` should match the values used by the request-sending method.
|
|
1814
|
+
* The method also adds or replaces the `Timestamp` parameter using the current system time.
|
|
1815
|
+
*
|
|
1816
|
+
* **Legacy MWS signing:** This method implements Amazon MWS signing and is not a general AWS
|
|
1817
|
+
* request signer. For AWS services that use AWS authorization providers, use {@link
|
|
1818
|
+
* Rest.setAuthAws}.
|
|
1819
|
+
*
|
|
1820
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1821
|
+
* {@link Rest.lastErrorText}.
|
|
1822
|
+
*/
|
|
1823
|
+
addMwsSignature(httpVerb: string, uriPath: string, domain: string, mwsSecretKey: string): void
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* Clears authentication providers and credentials previously configured through this class's
|
|
1827
|
+
* `SetAuth*` methods.
|
|
1828
|
+
*
|
|
1829
|
+
* This removes the active authentication provider and clears the manually configured {@link
|
|
1830
|
+
* Rest.authorization} value.
|
|
1831
|
+
*
|
|
1832
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1833
|
+
* {@link Rest.lastErrorText}.
|
|
1834
|
+
*/
|
|
1835
|
+
clearAuth(): void
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Adds or replaces a path-substitution parameter. Before a request is sent, occurrences of `name`
|
|
1839
|
+
* in the supplied request path are replaced by `value`.
|
|
1840
|
+
*
|
|
1841
|
+
* For example, setting `name` to `fileId` and `value` to `abc123` transforms
|
|
1842
|
+
* `/drive/v3/files/fileId` into `/drive/v3/files/abc123`.
|
|
1843
|
+
*
|
|
1844
|
+
* **Placeholders are application-defined:** The placeholder syntax is simply the text stored in
|
|
1845
|
+
* `name`; braces are not required unless they are part of the placeholder text you choose.
|
|
1846
|
+
*
|
|
1847
|
+
* Matching is case-sensitive and literal. Every occurrence of `name` is replaced, substitutions
|
|
1848
|
+
* are applied in the order they were added, and replacement applies to the entire `uriPath`
|
|
1849
|
+
* string, including any query portion.
|
|
1850
|
+
*
|
|
1851
|
+
* **Reserved characters:** The replacement is not a general path-segment encoder. Spaces are
|
|
1852
|
+
* percent-encoded, but reserved URI characters such as `/`, `?`, and `#` remain delimiters, and
|
|
1853
|
+
* existing percent escapes are preserved. Percent-encode reserved characters before calling this
|
|
1854
|
+
* method when they are intended to be data.
|
|
1855
|
+
*
|
|
1856
|
+
* Path substitutions persist across requests until replaced or removed with {@link
|
|
1857
|
+
* Rest.clearAllPathParams}.
|
|
1858
|
+
*
|
|
1859
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1860
|
+
* {@link Rest.lastErrorText}.
|
|
1861
|
+
*/
|
|
1862
|
+
addPathParam(name: string, value: string): void
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Removes all path-substitution parameters previously added with {@link Rest.addPathParam}.
|
|
1866
|
+
*
|
|
1867
|
+
* After clearing, placeholder text in later request paths is sent unchanged.
|
|
1868
|
+
*
|
|
1869
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1870
|
+
* {@link Rest.lastErrorText}.
|
|
1871
|
+
*/
|
|
1872
|
+
clearAllPathParams(): void
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Configures HTTP Basic authentication using the `SecureString` objects in `username` and
|
|
1876
|
+
* `password` for the username and password. The resulting request behavior is the same as {@link
|
|
1877
|
+
* Rest.setAuthBasic}.
|
|
1878
|
+
*
|
|
1879
|
+
* **Credential handling:** `SecureString` reduces unnecessary exposure of the credential text in
|
|
1880
|
+
* ordinary application strings. Basic authentication must still be protected by TLS.
|
|
1881
|
+
*
|
|
1882
|
+
* **Authorization precedence:** The Basic authentication provider generates the `Authorization`
|
|
1883
|
+
* header when each request is composed and takes precedence over a manually configured
|
|
1884
|
+
* Authorization value.
|
|
1885
|
+
*
|
|
1886
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1887
|
+
* {@link Rest.lastErrorText}.
|
|
1888
|
+
*/
|
|
1889
|
+
setAuthBasicSecure(username: SecureString, password: SecureString): void
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Copies the fully composed HTTP request generated while {@link Rest.debugMode} was `true` into
|
|
1893
|
+
* the `BinData` in `bd`. The captured data includes the request line, headers, and body that
|
|
1894
|
+
* would have been sent.
|
|
1895
|
+
*
|
|
1896
|
+
* **Diagnostic use:** Debug mode does not transmit the request. Treat captured requests as
|
|
1897
|
+
* sensitive because they may contain authorization headers, cookies, tokens, or request-body
|
|
1898
|
+
* credentials.
|
|
1899
|
+
*
|
|
1900
|
+
* `bd` is cleared and replaced. The captured bytes are the complete composed HTTP/1.1 request,
|
|
1901
|
+
* including chunk framing when a streaming request uses `Transfer-Encoding: chunked`.
|
|
1902
|
+
*
|
|
1903
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1904
|
+
* {@link Rest.lastErrorText}.
|
|
1905
|
+
*/
|
|
1906
|
+
getLastDebugRequest(bd: BinData): void
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* After {@link Rest.readResponseHeader} has been called, reads the next chunk of the response
|
|
1910
|
+
* body and appends the received bytes to the `BinData` in `bd`. The call waits until at least
|
|
1911
|
+
* `minSize` bytes are available, unless the response ends first. The final chunk may contain
|
|
1912
|
+
* fewer than `minSize` bytes, including zero bytes.
|
|
1913
|
+
*
|
|
1914
|
+
* Return valueMeaning
|
|
1915
|
+
*
|
|
1916
|
+
* | `-1` | | The read failed; inspect `LastErrorText`. |
|
|
1917
|
+
*
|
|
1918
|
+
* | `0` | | The remaining response bytes were returned and the response body is complete. |
|
|
1919
|
+
*
|
|
1920
|
+
* | `1` | | A chunk was returned and more response bytes remain. |
|
|
1921
|
+
*
|
|
1922
|
+
* **Incremental processing:** This method is useful when the application wants to process a long
|
|
1923
|
+
* response progressively rather than buffer it all at once.
|
|
1924
|
+
*
|
|
1925
|
+
* This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
|
|
1926
|
+
* {@link Rest.readRespChunkBdAsync}.
|
|
1927
|
+
*/
|
|
1928
|
+
readRespChunkBd(minSize: number, bd: BinData): number
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* Asynchronous form of {@link Rest.readRespChunkBd}: the same call on a native worker thread,
|
|
1932
|
+
* settling on the JavaScript thread. While it is pending, other calls on this object throw,
|
|
1933
|
+
* except {@link Rest.abort} (which cancels it) and the {@link Rest.onPercentDone} /
|
|
1934
|
+
* {@link Rest.onProgressInfo} callbacks, which report progress while it runs.
|
|
1935
|
+
*/
|
|
1936
|
+
readRespChunkBdAsync(minSize: number, bd: BinData): Promise<number>
|
|
1937
|
+
|
|
1938
|
+
/**
|
|
1939
|
+
* Copies operation-specific diagnostic or result information from the most recently completed
|
|
1940
|
+
* method into the `JsonObject` in `json`. Many methods do not produce additional JSON details, in
|
|
1941
|
+
* which case the object is empty.
|
|
1942
|
+
*
|
|
1943
|
+
* **Read immediately:** Call this immediately after the operation of interest because a later
|
|
1944
|
+
* method call may replace the stored JSON data.
|
|
1945
|
+
*/
|
|
1946
|
+
getLastJsonData(json: JsonObject): void
|
|
1947
|
+
|
|
1948
|
+
// ---- Events (ReactNativeGen_DESIGN.md §6) ----
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* Called with the percent completed (0..100) while a long-running method runs, when Chilkat
|
|
1952
|
+
* can measure progress. Runs on the JavaScript thread, so it is only useful with the
|
|
1953
|
+
* `...Async` methods (during a synchronous call the thread is busy and the events arrive
|
|
1954
|
+
* after it returns). Assign `undefined` to remove.
|
|
1955
|
+
*/
|
|
1956
|
+
onPercentDone?: (pctDone: number) => void
|
|
1957
|
+
|
|
1958
|
+
/**
|
|
1959
|
+
* Called with a name/value pair of progress information while a long-running method runs
|
|
1960
|
+
* (what is reported depends on the class and method). Runs on the JavaScript thread; see
|
|
1961
|
+
* {@link Rest.onPercentDone}. Assign `undefined` to remove.
|
|
1962
|
+
*/
|
|
1963
|
+
onProgressInfo?: (name: string, value: string) => void
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* Requests that the pending `...Async` call on this object stop at its next progress check.
|
|
1967
|
+
* The promise then rejects with Chilkat's abort error. Chilkat checks at least every
|
|
1968
|
+
* `heartbeatMs` milliseconds on the classes that have that property, so set it (e.g. 250)
|
|
1969
|
+
* for a responsive cancel. Harmless when nothing is pending.
|
|
1970
|
+
*/
|
|
1971
|
+
abort(): void
|
|
1972
|
+
}
|