[Missing functionality] no option to send GET request with Body
See original GitHub issueI’m trying to send a get request with a body using playwright. I did not find any resource / way how to do it. I would like to query the elasticsearch using get request with payload. example:
test("Get simki", async ({request})=> {
const response = await request.get('http://test.test.be/es/ad_matrix_agg_*/_search', {
headers:{
'Authorization': 'Basic token',
'Content-Type': 'application/json'
},
data:{
}
});
console.log(await response.json());
expect(response.status()).toBe(200);
})
issue: There is no option to add data in get request like in post request.
trying to use data in get request did not work and got this:
it seems that there is a missing functionality ( that IMO is basic in order to query ElasticSearch for instance) can it be resolved and be added soon?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
HTTP GET with request body - Stack Overflow
Yes, you can send a request body with GET but it should not have any meaning. If you give it meaning by parsing...
Read more >GET method doesn't support body payload #2136 - GitHub
For HTTP GET method Swagger UI doesn't send body payload. I prepared endpoint (products/test) with simple request data (name field). On 'Try it ......
Read more >OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >Add a Request Body to a POST Request | API Connector
If your POST request isn't working, a likely cause is a mismatched content type. Try adding in a content type into the header...
Read more >Set up a method request in API Gateway - AWS Documentation
It allows you to use a single API method setup for all of the supported HTTP methods of DELETE , GET , HEAD...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
@yury-s @pavelfeldman i have tested it with latest version playwright 1.26. It seems to work with fetch with GET method: fetch(‘http://test.test.com’, { method: ‘GET’… ( which is great) BUT it does not work with request.get ( as it mentioned in my first comment) . should it work also with request.get ?? thanks in advance
@moshikd It seems Playwright 1.27 includes the fix.