# Slim post Method is not working for Live Server

**URL:** https://discourse.slimframework.com/t/slim-post-method-is-not-working-for-live-server/1639
**Category:** Questions
**Created:** [July 3, 2017, 5:13am UTC](https://discourse.slimframework.com/t/slim-post-method-is-not-working-for-live-server/1639 "2017-07-03T05:13:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![noumanyasin](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@noumanyasin](https://discourse.slimframework.com/u/noumanyasin)
#### Post date: [July 3, 2017, 5:13am UTC](https://discourse.slimframework.com/t/slim-post-method-is-not-working-for-live-server/1639/1 "2017-07-03T05:13:56Z")

</div>

Hi guyz! I have been using slim for Rest api. Its post method is working fine in local host. but when i go on live server it does not send values to server. Can someone told me the solution of this problem. I have been looking for almost a week now, but can’t find any solution. Any help will be Appreciated thanks. below is my code for post method:

```
        $app->post('/register', function() use ($app) {
        // check for required params
        verifyRequiredParams(array('username', 'email', 'password'));

        $response = array();

        // reading post params
        $username = $app->request->post('username');
        $email = $app->request->post('email');
        $password = $app->request->post('password');

        // validating email address
        validateEmail($email);

        $db = new DbHandler();
        $res = $db->createUser($username, $email, $password);

        if ($res == USER_CREATED_SUCCESSFULLY) {
            $response["error"] = false;
            $response["message"] = "You are successfully registered";
        } else if ($res == USER_CREATE_FAILED) {
            $response["error"] = true;
            $response["message"] = "Oops! An error occurred while registereing";
        } else if ($res == USER_ALREADY_EXISTED) {
            $response["error"] = true;
            $response["message"] = "Sorry, this email already existed";
        }
        // echo json response
        echoRespnse(201, $response);
    });
```
