I’m trying to return some JSON data from curl using an API call with single quotes in it. Each time it acts like I haven’t formatted the URL correctly, giving an error code of 3.
Error:
* Could not resolve host: application
* Closing connection
curl: (6) Could not resolve host: application
* URL rejected: Port number was not a decimal number between 0 and 65535
* Closing connection
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
'TicketCreateTimeNewerMinutes' is not recognized as an internal or external command,
operable program or batch file.
I’ve tried leaving in the quotes as-is per the documentation I followed. I’ve also tried formatting the string with the single quotes encapsulated in double quotes thinking that curl couldn’t parse those. How do I format something with single quotes to get curl to work?
Quotes as is
curl -v -H ‘Content-type: application/json’ “https://[SITE]/otrs/nph-genericinterface.pl/Webservice/ConvCopier/TicketSearch/:TicketID?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=’June Meter Readings Due’?UserLogin=[REDACTED];Password=[REDACTED]”
Encapsulating quotes
‘curl -v -H ‘ + “‘” + ‘Content-type: application/json’ + “‘” + ‘”‘ + ‘https://[SITE]/otrs/nph-genericinterface.pl/Webservice/ConvCopier/TicketSearch/:TicketID?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=’ + “‘” + ‘Meter Readings Due’ + “‘” + ‘?UserLogin=[REDACTED];Password=[REDACTED]’ + ‘”
Amber Denton is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.