Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Custom hostnames - addHostname does not work

Open
#230 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api, cloud

Research direction

Start by reproducing the documented CustomHostnames::addHostname call against a free-plan Cloudflare account, then inspect how the function builds its SSL-related request data. Compare the request that fails with the modified version that succeeds; done means custom hostname creation works without removing required input.

Written by the indexing model from the issue text.

Description

When I try to execute the following:

new CustomHostnames($this->adapter)->addHostname(
            "zone_id",
            "mydomain.com",
        );

I get the error message: Unable to decode the JSON request body. Please check your input and try again..

I tried to modify the addHostname-function and remove the ssl-array, and by doing that, I could successfully create a custom hostname.

I am using a free-plan account on cloudflare.

Dominant language
PHP
Stars
674
Forks
268
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-php

All issues in cloudflare/cloudflare-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.