### Making GET Requests with Axios Source: https://www.npmjs.com/package/axios Examples of how to perform GET requests using Axios, including handling promises with .then()/.catch()/.finally() and using async/await syntax. It shows how to pass parameters in the URL or as a config object. ```javascript // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { // always executed }); // Optionally the request above could also be done as axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed }); // Want to use async/await? async function getUser() { try { const response = await axios.get('/user?ID=12345'); console.log(response); } catch (error) { console.error(error); } } ``` -------------------------------- ### Basic Usage Examples Source: https://www.npmjs.com/package/axios Demonstrates how to perform common HTTP requests like GET and POST using Axios, including error handling and async/await. ```APIDOC ## Example > **Note** : CommonJS usage > In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach: ```javascript import axios from 'axios'; //const axios = require('axios'); // legacy way // Make a request for a user with a given IDaxios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { // always executed }); // Optionally the request above could also be done asaxios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed }); // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() { try { const response = await axios.get('/user?ID=12345'); console.log(response); } catch (error) { console.error(error); } } ``` > **Note** : `async/await` is part of ECMAScript 2017 and is not supported in Internet Explorer and older browsers, so use with caution. Performing a `POST` request ```javascriptaxios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); ``` Performing multiple concurrent requests ```javascript function getUserAccount() { return axios.get('/user/12345'); } function getUserPermissions() { return axios.get('/user/12345/permissions'); } Promise.all([ getUserAccount(), getUserPermissions() ]) .then(function (results) { const acct = results[0]; const perm = results[1]; }); ``` ``` -------------------------------- ### Axios Configuration Precedence Example Source: https://www.npmjs.com/package/axios Explains and demonstrates the order of precedence for Axios configuration settings. It shows how library defaults, instance defaults, and request-specific configurations are merged, with the latter taking precedence. ```javascript // Create an instance using the config defaults provided by the library // At this point the timeout config value is `0` as is the default for the library const instance = axios.create(); // Override timeout default for the library // Now all requests using this instance will wait 2.5 seconds before timing out instance.defaults.timeout = 2500; // Override timeout for this request as it's known to take a long time instance.get('/longRequest', { timeout: 5000 }); ``` -------------------------------- ### Install a Package with Homebrew Source: https://brew.sh/ Use the 'brew install' command to install a package. This example shows how to install the 'wget' utility. Homebrew manages dependencies and installs packages in isolated directories. ```bash $ brew install wget ``` -------------------------------- ### Full ASAPP Chat SDK Web Integration Snippet Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-quick-start This is a comprehensive example of the ASAPP Chat SDK Web integration snippet, combining script embedding and initialization. It provides a complete reference for setting up the SDK on your website. ```javascript (function (win, doc, hostname, namespace, script) { script = doc.createElement('script'); win[namespace] = win[namespace] || function() { (win[namespace]._ = win[namespace]._ || []).push(arguments) } win[namespace].Host = hostname; script.async = 1; script.src = hostname + '/chat-sdk.js'; }(window, document, 'https://sdk.asapp.com', 'ASAPP')); ``` -------------------------------- ### Homebrew Formula Example (Ruby) Source: https://brew.sh/ This is a basic example of a Homebrew formula written in Ruby. It defines the metadata for a package, including its description, homepage, download URL, checksum, license, and installation steps. ```ruby class Wget < Formula desc "Internet file retriever" homepage "https://www.gnu.org/software/wget/" url "https://ftp.gnu.org/gnu/wget/wget-1.24.5.tar.gz" sha256 "fa2dc35bab5184ecbc46a9ef83def2aaaa3f4c9f3c97d4bd19dcb07d4da637de" license "GPL-3.0-or-later" def install system "./configure", "--prefix=#{prefix}" system "make", "install" end end ``` -------------------------------- ### Axios with SvelteKit Source: https://www.npmjs.com/package/axios Configuration example for using Axios with SvelteKit, addressing incompatibilities with relative paths and the standard URL API by using the custom fetch API. ```APIDOC #### Using with SvelteKit SvelteKit framework has a custom implementation of the fetch function for server rendering (so called `load` functions), and also uses relative paths, which makes it incompatible with the standard URL API. So, Axios must be configured to use the custom fetch API: ```javascript export async function load({ fetch }) { const {data: post} = await axios.get('https://jsonplaceholder.typicode.com/posts/1', { adapter: 'fetch', env: { fetch, Request: null, Response: null } }); return { post }; } ``` ``` -------------------------------- ### App Initialization - willFinishLaunchingWithOptions (Swift) Source: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application Illustrates the `application(_:willFinishLaunchingWithOptions:)` method within the UIApplicationDelegate protocol in Swift. This method is called after the app has launched but before it has finished its launch process, allowing for initial setup before the main event loop starts. ```swift func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool ``` -------------------------------- ### HTTP2 Adapter Configuration in Axios (JavaScript) Source: https://www.npmjs.com/package/axios Illustrates the experimental HTTP2 support in Axios, allowing selection of the HTTP version and passing native options. This example shows how to configure `httpVersion` and `http2Options`, along with progress handlers for uploads and downloads. ```javascript const form = new FormData(); form.append('foo', '123'); const {data, headers, status} = await axios.post('https://httpbin.org/post', form, { httpVersion: 2, http2Options: { // rejectUnauthorized: false, // sessionTimeout: 1000 }, onUploadProgress(e) { console.log('upload progress', e); }, onDownloadProgress(e) { console.log('download progress', e); }, responseType: 'arraybuffer' }); ``` -------------------------------- ### Making POST Requests with Axios Source: https://www.npmjs.com/package/axios Illustrates how to send POST requests with Axios, including sending data in the request body. The example shows handling success and error responses. ```javascript axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); ``` -------------------------------- ### Setting Rate Limits with Axios (Node.js) Source: https://www.npmjs.com/package/axios Demonstrates how to set download and upload rate limits for the http adapter in Node.js environments. It shows an example of limiting upload speed to 100KB/s. ```javascript const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, { onUploadProgress: ({progress, rate}) => { console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`) }, maxRate: [100 * 1024], // 100KB/s limit }); ``` -------------------------------- ### Start Streaming Request Body Example (JSON) Source: https://docs.asapp.com/apis/autotranscribe-media-gateway/start-streaming This JSON payload defines the parameters required to start an audio stream transcription. It includes essential fields like `namespace`, `guid`, `customerId`, and `agentId`, along with optional configurations for `autotranscribeParams` and platform-specific parameters like `siprecParams`. ```json { "namespace": "siprec", "guid": "0867617078-0032318833-2221801472-0002236962", "customerId": "customerId", "agentId": "agentId", "autotranscribeParams": { "language": "en-US" }, "siprecParams": { "mediaLineOrder": "CUSTOMER_FIRST" } } ``` -------------------------------- ### UIKit: App Launch Configuration (Swift) Source: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application Provides Swift code for configuring your app's behavior during launch. It includes methods like `application(_:willFinishLaunchingWithOptions:)` and `application(_:didFinishLaunchingWithOptions:)` to handle initial setup and options. ```swift func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Override point for customization after application launch. return true } func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Override point for customization after application launch. return true } ``` -------------------------------- ### API Endpoint for Flight Status Lookup Source: https://docs.asapp.com/generativeagent/configuring/connect-apis Defines the API endpoint for performing a GET request to look up flight status. This is a starting point for complex response mapping examples. ```http GET /flight ``` -------------------------------- ### Axios Fetch Adapter with Tauri (JavaScript) Source: https://www.npmjs.com/package/axios Provides an example of configuring Axios to work with the Tauri framework, utilizing its platform-specific fetch function. This setup allows requests to bypass CORS policy limitations common in Tauri applications. ```javascript import { fetch } from "@tauri-apps/plugin-http"; import axios from "axios"; const instance = axios.create({ adapter: 'fetch', onDownloadProgress(e) { console.log('downloadProgress', e); }, env: { fetch } }); const {data} = await instance.get("https://google.com"); ``` -------------------------------- ### Creating an Instance Source: https://www.npmjs.com/package/axios Explains how to create custom Axios instances with predefined configurations like base URLs and timeouts. ```APIDOC ### Creating an instance You can create a new instance of axios with a custom config. ##### axios.create([config]) ```javascript const instance = axios.create({ baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} }); ``` ### Instance methods The available instance methods are listed below. The specified config will be merged with the instance config. ##### axios#request(config) ##### axios#get(url[, config]) ##### axios#delete(url[, config]) ##### axios#head(url[, config]) ##### axios#options(url[, config]) ##### axios#post(url[, data[, config]]) ##### axios#put(url[, data[, config]]) ``` -------------------------------- ### Kinesis Video Streams Get Data Endpoint Source: https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-iam Example of getting the data endpoint for a Kinesis Video Stream, required for PUT_MEDIA operations. ```APIDOC ## Kinesis Video Streams Get Data Endpoint ### Description Retrieves the data endpoint for a specified Kinesis Video Stream, which is necessary for sending media data. ### Method AWS CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash aws kinesisvideo get-data-endpoint --stream-arn "arn:aws:kinesisvideo:us-west-2:999999999999:stream/custom-stream-name/1613732218179" --api-name "PUT_MEDIA" ``` ### Response #### Success Response (200) ```json { "DataEndpoint": "https://s-b12345.kinesisvideo.us-west-2.amazonaws.com" } ``` ``` -------------------------------- ### Initialize ASAPP Chat SDK Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-quick-start After embedding the script, initialize the ASAPP Chat SDK by calling the `ASAPP('load')` method with your `APIHostname` and `AppId`. These values are provided by ASAPP. This call determines whether to display the Chat SDK Badge based on business hours and trigger settings. ```javascript ASAPP('load', { APIHostname: 'API_HOSTNAME', AppId: 'APP_ID' }); ``` -------------------------------- ### Example Get Feed File Request Body Source: https://docs.asapp.com/reporting/file-exporter An example JSON payload for the '/getfeedfile' endpoint, specifying the feed, version, format, date, and file name. ```json { "feed": "feed_test", "version": "version=1", "format": "format=jsonl", "date": "dt=2022-06-27", "fileName": "file1.jsonl" } ``` -------------------------------- ### Example Query Examples Source: https://docs.asapp.com/apis/knowledge-base/retrieve-a-submission Illustrates the format for providing an array of example customer questions. ```json [ "What 5G plans do you offer?", "Is there an unlimited 5G plan?" ] ``` -------------------------------- ### Get Custom Responses API - cURL Example Source: https://docs.asapp.com/apis/autocompose/get-custom-responses This cURL command demonstrates how to make a GET request to the ASAPP API to retrieve custom responses. It requires `asapp-api-id` and `asapp-api-secret` headers for authorization. ```bash curl --request GET \ --url https://api.sandbox.asapp.com/autocompose/v1/responses/customs \ --header 'asapp-api-id: ' \ --header 'asapp-api-secret: ' ``` -------------------------------- ### Example Additional Instructions Source: https://docs.asapp.com/apis/knowledge-base/retrieve-a-submission Demonstrates the structure for an additional instruction, including a guideline and a sample response. ```json [ { "clarificationInstruction": "Emphasize that 5G coverage may vary by location", "exampleResponse": "Our 5G plans offer great speeds and data allowances, but please note that 5G coverage may vary depending on your location. You can check coverage in your area on our website." } ] ``` -------------------------------- ### OpenAPI Paths Object Example Source: https://spec.openapis.org/oas/latest.html This example demonstrates the structure of the Paths Object, defining a '/pets' path with a GET operation. It includes details about the operation's description, responses, and the schema for the returned JSON. ```yaml /pets: get: description: Returns all pets from the system that the user has access to responses: '200': description: A list of pets. content: application/json: schema: type: array items: $ref: '#/components/schemas/pet' ``` -------------------------------- ### Custom Instance Defaults Source: https://www.npmjs.com/package/axios Demonstrates how to create an Axios instance with its own set of default configurations. ```APIDOC ## Custom instance defaults ```javascript // Set config defaults when creating the instance const instance = axios.create({ baseURL: 'https://api.example.com' }); // Alter defaults after instance has been created instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; ``` ``` -------------------------------- ### Getting Header Values with AxiosHeaders#get (TypeScript) Source: https://www.npmjs.com/package/axios Demonstrates the usage of the `get` method to retrieve header values. It covers retrieving plain values, parsing key-value pairs from a string, applying a transformation function, and extracting specific parts using a regular expression. ```typescript const headers = new AxiosHeaders({ 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h' }); console.log(headers.get('Content-Type')); console.log(headers.get('Content-Type', true)); console.log(headers.get('Content-Type', (value, name, headers) => { return String(value).replace(/a/g, 'ZZZ'); })); console.log(headers.get('Content-Type', /boundary=(\w+)/)?.['0']); ``` -------------------------------- ### Start Support Action Mode Source: https://developer.android.com/reference/androidx/appcompat/app/AppCompatDelegate Starts an action mode. This method is used to initiate contextual action modes, typically for selections or actions on specific items. It requires an `ActionMode.Callback` object. ```Java abstract @Nullable ActionMode startSupportActionMode(@NonNull ActionMode.Callback callback) ``` -------------------------------- ### Installation Source: https://www.npmjs.com/package/axios Instructions on how to install Axios using various package managers and CDN links. ```APIDOC ## Installation ### Package manager Using npm: ```bash $ npm install axios ``` Using bower: ```bash $ bower install axios ``` Using yarn: ```bash $ yarn add axios ``` Using pnpm: ```bash $ pnpm add axios ``` Using bun: ```bash $ bun add axios ``` Once the package is installed, you can import the library using `import` or `require` approach: ```javascript import axios, {isCancel, AxiosError} from 'axios'; ``` You can also use the default export, since the named export is just a re-export from the Axios factory: ```javascript import axios from 'axios'; console.log(axios.isCancel('something')); ``` If you use `require` for importing, **only default export is available** : ```javascript const axios = require('axios'); console.log(axios.isCancel('something')); ``` For some bundlers and some ES6 linters you may need to do the following: ```javascript import { default as axios } from 'axios'; ``` For cases where something went wrong when trying to import a module into a custom or legacy environment, you can try importing the module package directly: ```javascript const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017) // const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017) ``` ### CDN Using jsDelivr CDN (ES5 UMD browser module): ```html ``` Using unpkg CDN: ```html ``` ``` -------------------------------- ### Axios Request Interceptor Example Source: https://www.npmjs.com/package/axios Provides an example of adding a request interceptor to an Axios instance. The interceptor function can modify the request config before it's sent or handle request errors. ```javascript const instance = axios.create(); // Add a request interceptor instance.interceptors.request.use(function (config) { // Do something before request is sent return config; }, function (error) { // Do something with request error re ``` -------------------------------- ### Axios Instance Methods Source: https://www.npmjs.com/package/axios Lists the available methods on a custom Axios instance, which mirror the global Axios methods but apply the instance's configuration. This allows for making requests with specific default settings. ```javascript axios#request(config) axios#get(url[, config]) axios#delete(url[, config]) axios#head(url[, config]) axios#options(url[, config]) axios#post(url[, data[, config]]) axios#put(url[, data[, config]]) ``` -------------------------------- ### Creating a Custom Axios Instance Source: https://www.npmjs.com/package/axios Demonstrates how to create a custom instance of Axios with pre-defined configurations such as baseURL, timeout, and default headers. This is useful for managing settings for specific API interactions. ```javascript const instance = axios.create({ baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} }); ``` -------------------------------- ### OpenAPI Path Item Object Example Source: https://spec.openapis.org/oas/latest.html This example demonstrates a Path Item Object in OpenAPI, showing how to define a GET operation for retrieving pets by ID, including parameters, responses, and a default error response. It also illustrates an additional 'COPY' operation. ```yaml get: description: Returns pets based on ID summary: Find pets by ID operationId: getPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' parameters: - name: id in: path description: ID of pet to use required: true schema: type: array items: type: string style: simple additionalOperations: COPY: description: Copies pet information based on ID summary: Copies pets by ID operationId: copyPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' ``` -------------------------------- ### Swift: application(_:didFinishLaunchingWithOptions:) Source: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application The `application(_:didFinishLaunchingWithOptions:)` method is an optional instance method of `UIApplicationDelegate`. It's called when the app's launch process is nearly complete, allowing for final setup before the app becomes active. It takes the shared `UIApplication` instance and a dictionary of launch options as input, returning a boolean to indicate success. ```swift @MainActor optional func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool ``` -------------------------------- ### Amazon Connect Parameters Example (JSON) Source: https://docs.asapp.com/apis/autotranscribe-media-gateway/start-streaming This JSON object specifies parameters for integrating with Amazon Connect streams. It includes the ARN of the Kinesis video stream and options to define the starting point for data retrieval from the stream. ```json { "streamArn": "arn:aws:kinesisvideo:us-east-1:000000000000:stream/streamtest-connect-asappconnect-contact-1", "startSelectorType": "FRAGMENT_NUMBER", "afterFragmentNumber": "some-fragment-number" } ``` -------------------------------- ### IAM Policy: Allow Get Data from Any Kinesis Video Stream Source: https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-iam Example IAM policy granting read-only access to all Kinesis Video Streams. ```APIDOC ## IAM Policy: Allow Get Data from Any Kinesis Video Stream ### Description This policy allows users to perform read-only operations such as describing, getting data, and listing Kinesis video streams. ### Method IAM Policy Statement ### Endpoint N/A ### Parameters None ### Request Example ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kinesisvideo:Describe*", "kinesisvideo:Get*", "kinesisvideo:List*" ], "Resource": "*" } ] } ``` ### Response None ``` -------------------------------- ### Axios with Tauri Source: https://www.npmjs.com/package/axios A minimal example of configuring Axios for use in a Tauri app, utilizing a platform fetch function that bypasses CORS policy for requests. ```APIDOC #### Using with Tauri A minimal example of setting up Axios for use in a Tauri app with a platform fetch function that ignores CORS policy for requests. ```javascript import { fetch } from "@tauri-apps/plugin-http"; import axios from "axios"; const instance = axios.create({ adapter: 'fetch', onDownloadProgress(e) { console.log('downloadProgress', e); }, env: { fetch } }); const {data} = await instance.get("https://google.com"); ``` ``` -------------------------------- ### Embed ASAPP Chat SDK Script Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-quick-start This snippet embeds the ASAPP Chat SDK into your website's HTML. It asynchronously downloads the SDK JavaScript and creates a global `ASAPP` function for interacting with the API. Place this script ideally near the top of your `
` element. ```javascript (function(w,d,h,n,s){s=d.createElement('script');w[n]=w[n]||function(){(w[n]._=w[n]._||[]).push(arguments)},w[n].Host=h,s.async=1,s.src=h+'/chat-sdk.js',s.type='text/javascript',d.body.appendChild(s)}(window,document,'https://sdk.asapp.com','ASAPP')); ``` -------------------------------- ### AxiosHeaders#get Method Source: https://www.npmjs.com/package/axios Retrieves the value of a specific header. It supports parsing the header value using a regular expression or a custom matcher function. ```APIDOC ## AxiosHeaders#get(headerName, matcher?) ### Description Retrieves the internal value of a header. It can optionally parse the header's value using a `RegExp` or a matcher function. ### Parameters * **`headerName`** (string) - The name of the header to retrieve. * **`matcher`** (true | AxiosHeaderMatcher | RegExp) - Optional. If `true`, parses key-value pairs from a string. If a `RegExp`, it's used to execute matching on the header value. If a function, it's used for custom matching. ### Request Example ```javascript const headers = new AxiosHeaders({ 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h', 'Accept-Language': 'en-US,en;q=0.9' }); // Get the raw Content-Type value console.log(headers.get('Content-Type')); // Expected output: multipart/form-data; boundary=Asrf456BGe4h // Get parsed key-value pairs from Content-Type console.log(headers.get('Content-Type', true)); // Expected output: Object [AxiosHeaders] { 'multipart/form-data': undefined, boundary: 'Asrf456BGe4h' } // Get the boundary value using RegExp console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[1]); // Expected output: Asrf456BGe4h // Get the first language quality value console.log(headers.get('Accept-Language', /q=(\d\.\d+)/)?.[1]); // Expected output: 0.9 ``` ``` -------------------------------- ### Comprehensive Chat Styling Example Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-customization A comprehensive example combining multiple chat styling options into a single JSON object. This includes API hostname and App ID, alongside various UI component styles. This example serves as a consolidated reference for integrating different styling aspects. No specific dependencies are mentioned beyond the JSON structure itself. ```json { "APIHostname": "sample.api.com", "AppId": " ``` -------------------------------- ### Axios Fetch Adapter with SvelteKit (JavaScript) Source: https://www.npmjs.com/package/axios Demonstrates configuring Axios for SvelteKit, accommodating its server-side rendering fetch implementation and relative path handling. This ensures compatibility within SvelteKit's data loading functions. ```javascript export async function load({ fetch }) { const {data: post} = await axios.get('https://jsonplaceholder.typicode.com/posts/1', { adapter: 'fetch', env: { fetch, Request: null, Response: null } }); return { post }; } ``` -------------------------------- ### Automatic URLSearchParams Serialization Source: https://www.npmjs.com/package/axios Axios automatically serializes data to URLSearchParams format if the 'Content-Type' header is set to 'application/x-www-form-urlencoded'. This example shows how nested objects are handled. ```javascript const data = { x: 1, arr: [1, 2, 3], arr2: [1, [2], 3], users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}] }; await axios.postForm('https://postman-echo.com/post', data, {headers: {'content-type': 'application/x-www-form-urlencoded'}} ); ``` -------------------------------- ### Automatic FormData Serialization Source: https://www.npmjs.com/package/axios Axios versions 0.27.0 and later support automatic object serialization to FormData when the 'Content-Type' header is 'multipart/form-data'. This example demonstrates a simple POST request. ```javascript import axios from 'axios'; axios.post('https://httpbin.org/post', {x: 1}, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({data}) => console.log(data)); ``` ```javascript const axios = require('axios'); var FormData = require('form-data'); axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({data}) => console.log(data)); ``` -------------------------------- ### UIKit: App Launch Configuration (Objective-C) Source: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application Objective-C code for configuring your application at launch. It includes methods for handling initial setup and launch options, similar to the Swift version. ```objective-c - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary