Commit 1223a73
authored
feat: add method property to responses (#123)
```console
# before: httpbingo lacks the "method" field but httpbin.org has it
$ curl -s https://httpbingo.org/anything | jq .method 9:31PM
null
$ curl -s https://httpbin.org/anything | jq .method
"GET"
# after: httpbingo has the method field!
$ curl -s http://0.0.0.0:8080/anything | jq .method
"GET"
```
This was mentioned in #6, but then not listed in #91
- I took the highly technical testing approach of adding a test for
`Method` anywhere in `handlers_test.go` that mentioned `Args`; do you
desire more tests? fewer tests?
- Anywhere else I should add this field that I didn't already?
For what it's worth, I discovered this when working on upgrading the
testing for our [httpsnippet
library](https://github.com/readmeio/httpsnippet); I wanted to use
`go-httpbin` but our tests expect the method field to be present in the
responses1 parent 7e81a93 commit 1223a73
3 files changed
+39
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
749 | 753 | | |
750 | 754 | | |
751 | 755 | | |
| 756 | + | |
752 | 757 | | |
753 | 758 | | |
754 | 759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| |||
601 | 607 | | |
602 | 608 | | |
603 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
604 | 613 | | |
605 | 614 | | |
606 | 615 | | |
| |||
645 | 654 | | |
646 | 655 | | |
647 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
648 | 660 | | |
649 | 661 | | |
650 | 662 | | |
| |||
675 | 687 | | |
676 | 688 | | |
677 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
678 | 693 | | |
679 | 694 | | |
680 | 695 | | |
| |||
731 | 746 | | |
732 | 747 | | |
733 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
734 | 752 | | |
735 | 753 | | |
736 | 754 | | |
| |||
781 | 799 | | |
782 | 800 | | |
783 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
784 | 805 | | |
785 | 806 | | |
786 | 807 | | |
| |||
846 | 867 | | |
847 | 868 | | |
848 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
849 | 873 | | |
850 | 874 | | |
851 | 875 | | |
| |||
905 | 929 | | |
906 | 930 | | |
907 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
908 | 936 | | |
909 | 937 | | |
910 | 938 | | |
| |||
942 | 970 | | |
943 | 971 | | |
944 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
945 | 977 | | |
946 | 978 | | |
947 | 979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
0 commit comments