PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 13, 2022

[FIXED] What is Axios default timeout

 October 13, 2022     axios     No comments   

Issue

I found in the documentation steps to set the timeout value.

const instance = axios.create({
  baseURL: 'https://some-domain.com/api/',
  timeout: 1000,
  headers: {'X-Custom-Header': 'foobar'}
});

But I could not find the default value in the official axios documentation - https://github.com/axios/axios

What is the default timeout?

Also, Underneath AXIOS uses http server/client (https://nodejs.org/api/http.html#http_class_http_clientrequest)

Does it use the http default timeout? I see my program timesout after 2 minutes.


Solution

According to the README, it is 0 which means no timeout

// timeout specifies the number of milliseconds before the request times out.

// If the request takes longer than timeout, the request will be aborted. timeout: 1000,

// default is 0 (no timeout)

https://github.com/axios/axios/blob/master/README.md#request-config



Answered By - ChrisG
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing