In the nodejs documentation:
query: Either the 'params' portion of the query string, or a querystring-parsed object. Example:
'query=string'or{'query':'string'}
Link: NodeJS URL
This part is confusing.
- When will
'query=string'happens? - When will this
{'query':'string'}also happens?
I have seen that when I do url.parse() it automatically converts the parameters into an object. My code will be buggy if I only support one format.
How will I know if url.parse() converts the parameters in this format: 'query=string'?