added in basic api request

This commit is contained in:
robert
2021-07-05 11:43:51 +01:00
parent aeaa1502c3
commit 5f7a572b91
7 changed files with 4758 additions and 5189 deletions
+30
View File
@@ -0,0 +1,30 @@
import axios from "axios";
import https from 'https';
const agent = new https.Agent({
rejectUnauthorized: false,
})
const crmHeaders = {
headers:{
"Content-Type": "application/json; charset=utf-8",
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json",
"Prefer": "odata.include-annotations=\"*\"",
}
}
export const getBasicSearch = (searchString) => {
console.log('got to axios', searchString)
return axios
//.get("https://devcrm2016.llcdt.gov.wales/DVPINS/api/data/v8.2/incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title&$filter=contains(title, '" + searchString + "')&$count=true", crmHeaders,{httpsAgent: new https.Agent({rejectUnauthorized:false})})
.get("http://dummy.restapiexample.com/api/v1/employees")
.then((res)=>res.data)
.catch((error)=>{
console.log(error)
})
}