import axios from 'axios'

class HttpRequestCreate {
  constructor(config) {
    this.config = config
  }
  createRequest() {
    const service = axios.create({
      baseURL: this.config.baseURL,
      method: this.config.method,
      responseType: this.config.responseType,
      timeout: this.config.timeout
    })
    service.defaults.headers[this.config.method]['Content-Type'] = this.config['Content-Type']
    return service
  }
}

export {
  HttpRequestCreate
}
