Every line of 'axios create' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
15 function createBaseInstance() { 16 const instance = axios.create({ 17 baseURL: BASE_URL, 18 }) 19 20 instance.interceptors.response.use(handleResponse, handleError) 21 return instance 22 }
265 create(attributes = {}, callback = undefined) { 266 if (this.collection.create) { 267 return this.collection.create(attributes, callback); 268 } 269 }
56 create : function HttpClient_create () { 57 // clean up, set up defaults. 58 transaction(this.txId, true); 59 this.txId = newTransactionId(); 60 this.setOptions({ 61 "method" : "GET", 62 "headers" : {}, 63 "body" : [] 64 }); 65 return this; 66 },
281 create(auth, opts) { 282 const call = { 283 path: '/images/create?', 284 method: 'POST', 285 options: opts, 286 isStream: true, 287 authconfig: auth, 288 statusCodes: { 289 200: true, 290 500: 'server error' 291 } 292 }; 293 return new Promise((resolve, reject) => { 294 this.modem.dial(call, (err, stream) => { 295 if (err) 296 return reject(err); 297 resolve(stream); 298 }); 299 }); 300 }
34 function create() { 35 // fetch( 36 // '/api/todo', { 37 // method: 'POST', 38 // headers: { 39 // 'Content-Type': 'application/json' 40 // }, 41 // body: JSON.stringify({ 42 // id: '4', 43 // subject: 's4' 44 // }) 45 // } 46 // ) 47 axios({ 48 url: 'api/todo', 49 method: 'POST', 50 headers: { 51 'Content-Type': 'application/json' 52 }, 53 data: JSON.stringify({ 54 id: '5', 55 subject: 's5' 56 }) 57 }) 58 .then(res => console.log(res)) 59 .catch(err => console.log(err)) 60 }
31 create(config: HttpConfig$ = DEFAULT_CONFIG): Http { 32 return new Http(config); 33 }
20 create (options) { 21 return new XFetch(options) 22 }
189 create (opts?: Object): Promise { 190 const call = { 191 path: '/networks/create?', 192 method: 'POST', 193 options: opts, 194 statusCodes: { 195 201: true, 196 404: 'plugin not found', 197 500: 'server error' 198 } 199 } 200 201 return new Promise((resolve, reject) => { 202 this.modem.dial(call, (err, conf) => { 203 if (err) return reject(err) 204 const network = new Network(this.modem, conf.Id) 205 network.data = conf 206 resolve(network) 207 }) 208 }) 209 }
120 MyRequest.create = function create(properties) { 121 return new MyRequest(properties); 122 };
214 function create(options) { 215 return new bluebird(function (resolve, reject) { 216 const onError = error => { 217 reject(error); 218 }, 219 pool = new pg.Pool(_.assign({Promise: require('bluebird')}, sanitize(options, poolOptionDefinitions))); 220 221 pool.on('error', onError); 222 223 queries.getSchemas(pool).then(schemas => { 224 pool.removeListener('error', onError); 225 resolve(new PostgresqlAdapter(pool, schemas)); 226 }).catch(onError); 227 }); 228 }