Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: post json support #998

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

bbangg
Copy link

@bbangg bbangg commented Dec 11, 2023

  • Added contentType for specifying the content type. Supported types: application/json, application/x-www-form-urlencoded
  • Added selenium_fetch package for using fetch with the driver.

Examples:

Example request to post application/json:

{
  "cmd": "request.post",
  "url":"http://example.com",
  "contentType": "application/json",
  "postData": "{\"key\":\"myKey\", \"value\": \"epicValue\"}"
}

Example request to post application/x-www-form-urlencoded:

{
  "cmd": "request.post",
  "url":"http://example.com",
  "contentType": "application/x-www-form-urlencoded",
  "postData": "a=b&c=d"
}

@4D5A90
Copy link

4D5A90 commented Mar 3, 2024

any news for this feature?

@bbangg
Copy link
Author

bbangg commented Mar 3, 2024

any news for this feature?

It's not merged yet. If you still want the support just use my fork. It has a 'improvement' branch.

@4D5A90
Copy link

4D5A90 commented Apr 3, 2024

I've tested but i keep getting this error when i want to POST json

Error: Message: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=117.0.5938.92)
Stacktrace:
0   chromedriver                        0x0000000102f82018 chromedriver + 5042200
1   chromedriver                        0x0000000102f79743 chromedriver + 5007171
2   chromedriver                        0x0000000102b203b6 chromedriver + 447414
3   chromedriver                        0x0000000102b05883 chromedriver + 338051
4   chromedriver                        0x0000000102b04333 chromedriver + 332595
5   chromedriver                        0x0000000102b049e9 chromedriver + 334313
6   chromedriver                        0x0000000102b15a48 chromedriver + 404040
7   chromedriver                        0x0000000102b2dbce chromedriver + 502734
8   chromedriver                        0x0000000102bb240f chromedriver + 1045519
9   chromedriver                        0x0000000102b96433 chromedriver + 930867
10  chromedriver                        0x0000000102b61062 chromedriver + 712802
11  chromedriver                        0x0000000102b6228e chromedriver + 717454
12  chromedriver                        0x0000000102f43db9 chromedriver + 4787641
13  chromedriver                        0x0000000102f48f6d chromedriver + 4808557
14  chromedriver                        0x0000000102f4fec2 chromedriver + 4837058
15  chromedriver                        0x0000000102f49c9d chromedriver + 4811933
16  chromedriver                        0x0000000102f1befc chromedriver + 4624124
17  chromedriver                        0x0000000102f68898 chromedriver + 4937880
18  chromedriver                        0x0000000102f68a50 chromedriver + 4938320
19  chromedriver                        0x0000000102f7937e chromedriver + 5006206
20  libsystem_pthread.dylib             0x00007ff80dbf5202 _pthread_start + 99
21  libsystem_pthread.dylib             0x00007ff80dbf0bab thread_start + 15

Response in 3.705 s
127.0.0.1 POST http://localhost:8191/v1 500 Internal Server Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants