Well you can sit up in bed and do this.
But unfortunately it's impossible to do computer stuff with your head in a pillow laying flat or near flat.
The problem is Cranial pressure.
When you're sleeping, your blood pressure drops enough such that you don't get a headache.
However, if you lay flat in bed, while awake for extended periods, you WILL get a headache, because the wakeful blood pressure ontop of the pillow pressure on your neck (compressing arteries) is overloading for the brain.
How do I know, I've tried it..
At the end of the day, Couchputering is much more practical..