✌️
This commit is contained in:
parent
49da90289a
commit
80f9a81ac4
14 changed files with 191 additions and 271 deletions
|
|
@ -84,17 +84,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
|
||||
const endpoint = instance.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate';
|
||||
|
||||
const res = await fetch(endpoint, {
|
||||
const res = await this.httpRequestService.fetch({
|
||||
url: endpoint,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'User-Agent': config.userAgent,
|
||||
Accept: 'application/json, */*',
|
||||
},
|
||||
body: params,
|
||||
body: params.toString(),
|
||||
// TODO
|
||||
//timeout: 10000,
|
||||
agent: (url) => this.httpRequestService.getAgentByUrl(url),
|
||||
});
|
||||
|
||||
const json = (await res.json()) as {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue