I've got a web component in my app which was go to a url and get its content for me.
It was working yesterday and I did not change anything but now it is not working.
It goes to url, response code is 200 but in content I saw:
How can I turn on js in web component?
Thanks in advance.
Addition edit: how to send proper user agent data to website if its possible? so website can not understand that I am connecting with web component and will not occur errors.
Please show your blocks, the url, any api documentation, the expected responseContent.
Does it work in a browser/webviewer?
Probably need to send some headers for the user agent etc.
Yes, I think it is. My blocks are so complicated but I can simulate in new project:
Yes it does in both.
I will wait until you post something of use (url, api docs, expected response)
ok, this is an example url
this is response content.
That is what you will get if you call a web page with the web component.
I get that back too, no errors reported
Are there a way to use headers?
It was working yesterday, I don't know if they changed something on website.
As I said, if you call a web page with the web page, it will return the source of the page, the same as if you right click on the page in a browser and select view-source. I see it is returning an error page, nonetheless.
You say it was working yesterday. What was working ? Just calling the url you have provided will not "do" anything.
Why not use the webviewer to access the page?
I need webpage's source code and I can not find source code information in webviewer.
I meant it was loading JS yesterday because I could reach page source codes.
in a webviewer:
First run this, to get page (sets up cookies etc.)
then run this
and you get to original page source
This is AWASOME thanks, but I could not figure out how to get page source inside a variable.
When I did what you said, I can see source code but I can not do anything with it.
I was using "web" to get source code as a variable. Is it possible in webviewer?
This should return the entire source code of the rendered web page
if you just want the body use
Please note that this method returns the source code of the rendered web page, other methods do not do this.
I was using "web" component's "response code" too. Is it possible to see response code in WebViewer?
Found a solution like this
If did not loaded, It would not contain CSRF TOKEN
But if there are better way, I wanted to learn.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.