Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-melli committed Jan 16, 2025
1 parent 6238649 commit 63b702a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
28 changes: 28 additions & 0 deletions example/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const url = 'https://korcen.shibadogs.net/api/v1/korcen'

const headers = {
'accept': 'application/json',
'Content-Type': 'application/json'
}

const data = {
input: '욕설이 포함될수 있는 메시지',
'replace-front': '<',
'replace-end': '>'
}

fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => {
console.log(response.status)
return response.json()
})
.then(data => {
console.log(data)
})
.catch(error => {
console.error('Error:', error)
})
19 changes: 19 additions & 0 deletions example/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests

url = 'https://korcen.shibadogs.net/api/v1/korcen'

headers = {
'accept': 'application/json',
'Content-Type': 'application/json'
}

data = {
'input' : '욕설이 포함될수 있는 메시지',
'replace-front': '<',
'replace-end' : '>'
}

response = requests.post(url, headers=headers, json=data)

print(response.status_code)
print(response.text)

0 comments on commit 63b702a

Please sign in to comment.