Force http_get to return content after loading it to the browser
See original GitHub issueI’m using the following script for getting request and response structures:
function main(splash)
local url = splash.args.url
local reply = splash:http_get(url)
assert(splash:wait(1))
return {
reply.request.info,
reply.info
}
end
From documentation - splash:http_get method returns content without loading result to the browser. Actually I would need to get content.text as it is returned by splash:go(url) method after loading content to the browser. Is it possible to don’t call two separate methods twice?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Is there a way to force ASP.NET Web API to return plain text?
You can force it by setting the content type header on httpResponseMessage.Headers to text/plain in your controller provided you have registered ...
Read more >Using fetch to Send HTTP Requests in JavaScript - Stack Abuse
An HTTP response object that's returned after a successful fetch() requests can be parsed to various formats. In addition to the json() method, ......
Read more >Redirections in HTTP - MDN Web Docs - Mozilla
When browsers receive a redirect, they immediately load the new URL provided in the Location header. Besides the small performance hit of an ......
Read more >Format response data in ASP.NET Core Web API
ASP.NET Core MVC supports formatting response data, using specified formats or in response to a client's request.
Read more >How to make JavaScript wait for a API request to return?
Async: It makes javascript execute promise based codes as if they were synchronous and return a value without breaking the execution thread.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@slotix I think there are two options:
splash:go
and use splash:on_response to store raw response body of the first non-redirect response; it will require setting splash.response_body_enabled totrue
.The following code works for me perfectly