Why does PHP cURL drop numeric keys? Why does PHP cURL drop numeric keys? curl curl

Why does PHP cURL drop numeric keys?


Assuming your sending content type application/x-www-form-urlencoded means you're sending HTML Form data. (PHP curl defaults to this content type as it is the w3c recommended default https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).

According to the spec, NAME tokens (a.k.a. the post and get parameter names )have to start with an letter: https://www.w3.org/TR/html4/types.html#h-6.2

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

This is probably why it's not being handled as you expect, because starting a param in the POST body with a number for the indicated content type is unsupported.