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

**URL:** https://discourse.slimframework.com/t/getting-an-extra-colon-charater-in-my-the-header-of-my-response/156
**Category:** Questions
**Created:** [April 19, 2016, 9:36pm UTC](https://discourse.slimframework.com/t/getting-an-extra-colon-charater-in-my-the-header-of-my-response/156 "2016-04-19T21:36:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![k14](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@k14](https://discourse.slimframework.com/u/k14)
#### Post date: [April 19, 2016, 9:36pm UTC](https://discourse.slimframework.com/t/getting-an-extra-colon-charater-in-my-the-header-of-my-response/156/1 "2016-04-19T21:36:53Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![MathMarques](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/mathmarques/32/501_2.png) [@MathMarques](https://discourse.slimframework.com/u/MathMarques)
#### Post date: [April 20, 2016, 1:28am UTC](https://discourse.slimframework.com/t/getting-an-extra-colon-charater-in-my-the-header-of-my-response/156/2 "2016-04-20T01:28:40Z")

</div>

The correct use of `withHeader()` is:

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

```

Just change and it’ll work.

---

<div class="post-metadata">

### Author: ![k14](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@k14](https://discourse.slimframework.com/u/k14)
#### Post date: [April 20, 2016, 2:23pm UTC](https://discourse.slimframework.com/t/getting-an-extra-colon-charater-in-my-the-header-of-my-response/156/3 "2016-04-20T14:23:07Z")

</div>

Ah thank you! That makes sense.
