Emmanuel Odeke d67a621715
http: http-utils added after extraction
Found common http utils that were being multiply duplicated across
many libraries and since am moving things in basecoin/unstable to
add for more functionality, it's better to put them in one
place.

Utilities and tests added:
- [X] FparseJSON
- [X] FparseAndValidateJSON
- [X] ParseRequestJSON
- [X] ParseAndValidateRequestJSON
- [X] WriteCode
- [X] WriteError
- [X] WriteSuccess
- [X] ErrorResponse

During review from @ethanfrey, made updates:
* Removed tt.want since it was a distraction/artifact that made
the reviewer think the tests weren't testing for both failed
and passed results.
* Added ErrorWithCode as WithCode is a common options pattern
in Go that could cause confusion:
  ErrorWithCode(error, int) ErrorResponse
* Using json.NewDecoder(io.Reader) error instead of
ioutil.ReadAll(io.Reader) to slurp all the bytes.
* Added more test scenarios to achieve 100% coverage of http.go
2017-08-02 11:38:52 -06:00
2017-06-23 22:21:36 -04:00
2017-04-18 16:33:27 -04:00
2017-04-18 17:56:05 -04:00
2017-05-23 23:06:20 +02:00
2017-04-21 16:04:58 -04:00
2017-04-18 17:56:05 -04:00
2017-04-18 17:56:05 -04:00
2017-06-16 11:40:14 -04:00
2017-05-01 11:30:24 -04:00
2017-05-05 21:52:01 +04:00
2017-04-18 17:56:05 -04:00
Description
No description provided
Apache-2.0 63 MiB
Languages
Go 72.6%
C 17.7%
Shell 3.2%
Python 1.6%
Makefile 1%
Other 3.7%