-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cdp): call callback after session has been associated with request (
- Loading branch information
Showing
5 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,21 +9,44 @@ | |
</head> | ||
<body> | ||
<h1>Post Data</h1> | ||
<pre></pre> | ||
<details> | ||
<summary> | ||
Text | ||
</summary> | ||
<pre id="text"></pre> | ||
</details> | ||
<details> | ||
<summary> | ||
Blob | ||
</summary> | ||
<pre id="blob"></pre> | ||
</details> | ||
</body> | ||
<script> | ||
const postData = { | ||
document: document.body.innerHTML, | ||
}; | ||
const pre = document.querySelector('pre') | ||
const text = document.querySelector('#text'); | ||
const blob = document.querySelector('#blob'); | ||
const blobContent = new XMLSerializer().serializeToString(document); | ||
fetch('/api/echo', { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify(postData) | ||
body: JSON.stringify({ | ||
name: 'John Doe', | ||
email: '[email protected]', | ||
message: 'Hello, world!' | ||
}) | ||
}) | ||
.then(response => response.json()) | ||
.then(data => pre.innerText = JSON.stringify(data, null, 2)) | ||
.then(data => text.innerText = JSON.stringify(data, null, 2)) | ||
.catch(error => console.error(error)); | ||
fetch('/api/echo', { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'text/xml' }, | ||
body: new Blob([blobContent]) | ||
}) | ||
.then(response => response.text()) | ||
.then(data => blob.innerText = data) | ||
.catch(error => console.error(error)); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters