-
Notifications
You must be signed in to change notification settings - Fork 677
Closed
Closed
Copy link
Labels
AREA: docsAn issue related to the product documentation.An issue related to the product documentation.TYPE: enhancementThe accepted proposal for future implementation.The accepted proposal for future implementation.
Description
What is your Scenario?
There isn't information about how to change an URL of the request in the RequestHook,
What are you suggesting?
There should be informed on how to change a request URL. It needs to change hostname, host, port, protocol and path of the e.requestOptions on values that are required for a new resource. Also, We should change the request headers depending on the new resource. Option url is read-only, which means that trying to change it doesn't alter the real url.
For example:
class CustomRequestHook extends RequestHook {
onRequest (e) {
e.requestOptions.protocol = 'https:';
e.requestOptions.host = 'devexpress.github.io';
e.requestOptions.hostname = 'devexpress.github.io';
e.requestOptions.port = '';
e.requestOptions.path = '/testcafe/example/thank-you.html';
e.requestOptions.headers['host'] = 'devexpress.github.io';
}
onResponse (responseEvent) {
}
}What alternatives have you considered?
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AREA: docsAn issue related to the product documentation.An issue related to the product documentation.TYPE: enhancementThe accepted proposal for future implementation.The accepted proposal for future implementation.