Getting an extra colon charater in my the header of my response

Hello,
I am using slim v3 and have a route that looks like this:

$slim->post('/forms', function ($request, $response, $args) use ($app) {
    // note $app here is not slim

    $params = $request->getParsedBody();
    $form = $app->getFormRegistry()->addForm($params);
    
    // is true and will run the if block.
    if ($form != null) {

        // $form[Form::ID] has value of 9 (not "9:")

        return $response->withHeader("Location:".api_host."/forms/".$form[Form::ID])
            ->withStatus(201);
    }
    return generalError($response);
});

When I return my response, the Location header is getting a colon concated to the end of it and I am not sure where it is coming from.

The response headers I get back are

Connection →close
Content-Length →14
Content-Type →text/html;charset=UTF-8
Date →Tue, 19 Apr 2016 17:26:40 GMT
Location →http://internal.site/forms/9:
Server →Apache/2.2.15 (CentOS)
X-Powered-By →PHP/5.6.17

Any help is appreciated. Thanks.

The correct use of withHeader() is:

$response->withHeader('Location', api_host.'/forms/'.$form[Form::ID]);

Just change and it’ll work.

Ah thank you! That makes sense.