modify http method

Modified the http method to use `write-region`  instead of `write-file`.