Forum Discussion
Way to find the absolute URL when switchMode is called?
Hello everyone! So, what I meant to ask is there any way to get to know the absolute URL when we call lets say switchMode(). In the source code, its using this:
const url = '/report/switchMode/' + newMode;
try {
const response = await this.service.hpm.post<void>(url, null, { uid: this.config.uniqueId }, this.iframe.contentWindow);
return response.body;
}
I know we are using hpm to send the request but to where exactly? And please correct me if I am wrong, but I can see we are just passing the relative URL to the request.
PS: Pardon me please. Forgot to mention using powerbi-client JS API here.
- Anonymous3 years ago
HI alohaes,
If these operations do not send any requests in web browser trace, it mean switch mode function only interact with embedded iframe to turn on edit mode layouts and not send any requests. (this mode has been integrated into the embedded contents)
Regards,
Xiaoxin Sheng
4 Replies
- AnonymousNot applicable
Hi alohaes,
I checked the client API document but not found the function directly get absolute URL.
Perhaps you can try to use web browser debug or fiddler to trace the request URL when you invoke the switch mode function.
Steps:
1. Open the web page where you are using the powerbi-client JS API with switchMode.
2. Open the developer tools in your web browser. You can do this by pressing F12 or Ctrl+Shift+I on Windows, or Cmd+Option+I on Mac.
3. Click on the Network tab.
4. Perform the action that triggers the request you want to trace.
5. Look for the request in the list of network requests. You can filter the requests by typing in a keyword in the search box.
6. Click on the request to view its details, including the request URL and response data.Regards,
Xiaoxin Sheng
- alohaesHelper I
Greetings! Thank you for your help and I tried looking through the requests from the dev console like you said but could not find anything related to mode switching request when switched to edit mode. The search filter shows up as empty. (Searched with keywords switchmode and edit)
- AnonymousNot applicable
HI alohaes,
If these operations do not send any requests in web browser trace, it mean switch mode function only interact with embedded iframe to turn on edit mode layouts and not send any requests. (this mode has been integrated into the embedded contents)
Regards,
Xiaoxin Sheng