We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't work out how to format the payload. I've tried this:
include( plugin_dir_path( __FILE__ ) . 'StackPath.php' ); $stackpath = new StackPath\StackPath( "my-default-stack-38343c", SP_CLIENT_IDZZ, SP_CLIENT_SECRETZZ ); $response2 = $stackpath->post( "cdn/v1/stacks/my-default-stack-38343c/purge", [ "json" => [ "items" => [ "purgeAllDynamic" => true, "invalidateOnly" => false, "recursive"=>true, "url" =>"https://thecommunitychurch.online" ] ] ] );
But I get the response: "json: cannot unmarshal object into Go value of type []json.RawMessage"
If I remove the json outer wrapper:
$response2 = $stackpath->post( "cdn/v1/stacks/my-default-stack-38343c/purge", [ "items" => [ "purgeAllDynamic" => true, "invalidateOnly" => false, "recursive"=>true, "url" =>"https://thecommunitychurch.online" ] ] );
the response is "Items must be provided"
If I send it without the "items" wrapper I get the same: "Items must be provided"
$response2 = $stackpath->post( "cdn/v1/stacks/my-default-stack-38343c/purge", [ "purgeAllDynamic" => true, "invalidateOnly" => false, "recursive"=>true, "url" =>"https://thecommunitychurch.online" ] );
Any help would be appreciated ;)
The text was updated successfully, but these errors were encountered:
items is an array of associative arrays (additional square brackets)
insted of ["json" => ["items" => ["url" => "..."]]]; we need ["json" => ["items" => [["url" => "..."]]]];
["json" => ["items" => ["url" => "..."]]];
["json" => ["items" => [["url" => "..."]]]];
Sorry, something went wrong.
No branches or pull requests
I can't work out how to format the payload. I've tried this:
But I get the response: "json: cannot unmarshal object into Go value of type []json.RawMessage"
If I remove the json outer wrapper:
the response is "Items must be provided"
If I send it without the "items" wrapper I get the same: "Items must be provided"
Any help would be appreciated ;)
The text was updated successfully, but these errors were encountered: