axios-axios/lib/adapters
Subhan Kumar Rai d7e6065346
fix(http2): Use port 443 for HTTPS connections by default. (#7256)
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2025-12-19 02:22:38 +02:00
..
adapters.js docs: add jsdoc to adapters (#7134) 2025-10-12 16:38:54 +02:00
fetch.js fix(fetch): prevent TypeError when config.env is undefined (#7155) 2025-10-16 18:20:26 +03:00
http.js fix(http2): Use port 443 for HTTPS connections by default. (#7256) 2025-12-19 02:22:38 +02:00
README.md style: get rid of redundency in imports (#6315) 2025-11-12 21:11:56 +02:00
xhr.js style: get rid of redundency in imports (#6315) 2025-11-12 21:11:56 +02:00

axios // adapters

The modules under adapters/ are modules that handle dispatching a request and settling a returned Promise once a response is received.

Example

var settle = require('../core/settle');

module.exports = function myAdapter(config) {
  // At this point:
  //  - config has been merged with defaults
  //  - request transformers have already run
  //  - request interceptors have already run
  
  // Make the request using config provided
  // Upon response settle the Promise

  return new Promise(function(resolve, reject) {
  
    var response = {
      data: responseData,
      status: request.status,
      statusText: request.statusText,
      headers: responseHeaders,
      config: config,
      request: request
    };

    settle(resolve, reject, response);

    // From here:
    //  - response transformers will run
    //  - response interceptors will run
  });
}