Question: I have a database which stores a diary of events (pretty similar to how facebook works) these can be for a specific single date, or recurring each year. For example I may have a wedding on 1st June 2013 and a birthday on the 4th May every year. I am trying to extract a list of all events that are occurring in the next year, in order of when they will happen.

```
id u_id title           event_day  event_month  event_year
1   1   Wedding         22         02           2013
2   1   Jan Birthday    1          1            
3   1   May Birthday    04         5            

```

Using this query, I can fill in the current year, but then if an event has already occurred (such as 'jan birthday' in the data above it needs to be the current year plus one that is add:

```
SELECT title, IF(event_year = '', YEAR(CURDATE()), event_year) AS ev_year,
event_day, event_month 
FROM `events`

```

returns:

```
title           ev_year event_day  event_month  
Wedding         2013    22         02
Jan Birthday    2014    1          1
May Birthday    2014    04         5

```

Thanks

Answer: 
In my case the header's "content-length" property was insufficient for the data being posted.
Make sure "content-length" is set to the length of the data you are sending.
I had a problem with the POST request handling:

```
request.on('data', function (data) {
    body +=data;
}); 
request.on('end',function(){
    ... //do some stuff
    }       

    var headers={'Content-Type': 'text/plain'};
    response.writeHeader(200, headers); 
    response.end();
});

```

transferring my code to GET method solved it. 

now I can send a response immediately and then process the queryData from GET.

I still not completely understand why and how this solved it... but "if it works - don't touch it!" :)