Skip to content

Commit

Permalink
feat(network): curl add copy request header
Browse files Browse the repository at this point in the history
  • Loading branch information
bumaociyuan committed Oct 21, 2022
1 parent 9fdb330 commit b7391b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/network/network.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
} else if (typeof req.postData === 'object' && req.postData !== null) {
curl += ` -d '${tool.safeJSONStringify(req.postData)}'`;
}
if (req.requestHeader != null) {
Object.entries(req.requestHeader).forEach(([key, value])=>{
curl += ` -H '${key}: ${value}'`;
})
}
return `${curl} '${req.url}'`;
};
Expand Down

0 comments on commit b7391b8

Please sign in to comment.