jquery / jquery/api.jquery.com

document the wire type of parameter of data of function jQuery.post()

Open
#1,115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
325
Forks
260
PR merge metrics
No merged PRs in 30d

Description

What is the wire type of parameter of data of jQuery.post()?
If I pass in an object like {"n":"bar"} , what I will get in the ajax http post body? a json like '{"n":"bar"}' or a url-encoding query like "n=bar" ?
If I pass in a string like "hello world", what I will get in the ajax http post body? Direct put in http post body?

The document at https://api.jquery.com/jquery.post/ do not tell me anything about it.

notice
  • I can write a web server and use the jquery.post() to try and guess what will happen, but I want know it before I write my web server logic.
  • Parameter dataType is The type of data expected from the server. , not the request data type.
  • I have found some details in https://github.com/jquery/jquery/issues/2594#issuecomment-140113401 . But it is hard to find in google and it is not all the problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the jQuery.post() API page linked in the issue and read the related details in jQuery issue #2594. Document what request body is produced when data is an object versus a string, including how dataType differs; the page is done when these cases are answered directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
jquery
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.