Skip to content

Tickets cURL code is illegal #51

@greenreader9

Description

@greenreader9

Affected pages:

Issue:
These pages include a sample cURL call such as (formatted):

curl -X POST 
    -u username:password 
    -d "api_user=username&api_key=password&domain_name=subdomain.example.com&ticket_id=000000" 
    -F ticket_id=000000 
    -F clientusername=hname_12345678 
    -F comments=Test 
    -F ipaddress=1.1.1.1
    "https://panel.myownfreehost.net/xml-api/supportreplyticket.php"

Per documentation, -d and -F are mutually excusive, only one can be used (docs, docs)

To resolve:
Untested, but I think moving all them to -d is the correct way to go, that would also help these pages remain consistent with the rest.

The following PHP code works if you want to model off it:

$post_data = array(
	'comments' => $comm6,
	'ticket_id' => $comm7,
        'clientusername' => $comm5,
	'domain_name' => $comm4,
	'ipaddress' => $comm3,
	'api_user' => $comm2,
	'api_key' => $comm1
);

$curl = curl_init();
curl_setopt_array($curl, array(
	 CURLOPT_URL => 'https://panel.myownfreehost.net/xml-api/supportreplyticket',
	 CURLOPT_RETURNTRANSFER => true,
	 CURLOPT_MAXREDIRS => 10,
	 CURLOPT_TIMEOUT => 0,
	 CURLOPT_POST => 1,
	 CURLOPT_FOLLOWLOCATION => true,
	 CURLOPT_CUSTOMREQUEST => 'POST',
	 CURLINFO_HEADER_OUT => true,
	 CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
	 CURLOPT_POSTFIELDS => $post_data,
));

$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority one, highest priority fixdocumentationImprovements or additions to documentationhelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions