Hi trying to use fts using post request when i am trying to access couchase using POSTMAN its works.
but when i am sending post request through jquery its saying forbidden 4.3 here is my code
let headers = new Headers();
headers.set('Content-Type','application/json;');
headers.set('Authorization', 'Basic ' + btoa('admin' + ":" + '5121451214'));
let bostdata =
{
"explain": false,
"fields": ['*'],
"highlight": {},
"query": {
"query": "9059752843"
}
}
// Default options are marked with *
let response = fetch(‘http://localhost:8094/api/index/def_search_customer_index/query/’,
{
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'no-cors', // no-cors, *cors, same-origin
cache: 'no-cache',
referrer: '*client',
credentials: 'include',
headers: headers,
body: JSON.stringify(bostdata)
});
let resdara = response.json();
console.log(resdara);
//BROWSER RESPONSE
- uest URL:
http://localhost:8094/api/index/def_search_customer_index/query
- Request Method:
POST
- Status Code:
403 Forbidden
- Remote Address:
- Referrer Policy:
no-referrer-when-downgrade
-
Response Headersview source
-
Content-Length:
191
- Content-Type:
application/json
- Date:
Sat, 21 Dec 2019 01:15:20 GMT
- X-Content-Type-Options:
nosniff
-
Request Headersview source
-
Accept:
3./*
- Accept-Encoding:
gzip, deflate, br
- Accept-Language:
en-US,en;q=0.9
- Cache-Control:
max-age=0
- Connection:
keep-alive
- Content-Length:
78
- Content-Type:
text/plain;charset=UTF-8
- Cookie:
ui-auth-localhost%3A8091=e8c3dce9735ba928f7c590d742a24987; st_sessions=cmlvncdr01nhqofm408jumvfl554kmt0
- Host:
localhost:8094
- Origin:
- Referer:
http://localhost/cb_stitchit/*client
- Sec-Fetch-Mode:
no-cors
- Sec-Fetch-Site:
same-site
- User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
-
Request Payloadview source
-
-
{explain: false, fields: ["*"], highlight: {}, query: {query: “9059752843”}}
-
explain: false
-
fields: ["*"]
-
highlight: {}
-
query: {query: “9059752843”}
-