AIAnytime / AIAnytime/GPT-Shield-AI-Plagiarism-Detector
When I send text with code block written by openAi - perplexity returns infinity.
- 主要语言
- Python
- 星标
- 21
- 派生
- 6
- PR 合并指标
- 30 天内没有已合并 PR
描述
Example of text
```
In JavaScript, you can make an HTTP request using the `XMLHttpRequest` object or the `fetch` API. Here's an example of how to make a GET request using the `fetch` API:
```javascript
fetch('https://api.example.com/data')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log(data);
})
.catch(error => {
console.error('There was a problem with the request: ', error);
});
```
You can also make a POST request using the `fetch` API:
```javascript
fetch('https://api.example.com/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ key: 'value' })
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log(data);
})
.catch(error => {
console.error('There was a problem with the request: ', error);
});
```
If you prefer to use the `XMLHttpRequest` object, here's an example of how to make a GET request:
```javascript
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.example.com/data', true);
xhr.onload = function() {
if (xhr.status >= 200 && xhr.status < 300) {
console.log(JSON.parse(xhr.responseText));
} else {
console.error('There was a problem with the request');
}
};
xhr.send();
```
I hope this helps with making HTTP requests in JavaScript! If you have any more questions, feel free to ask.
```
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。