(t, e = "GET")
| 152 | this.env = t |
| 153 | } |
| 154 | send(t, e = "GET") { |
| 155 | t = "string" == typeof t ? { |
| 156 | url: t |
| 157 | } : t; |
| 158 | let s = this.get; |
| 159 | return "POST" === e && (s = this.post), new Promise((e, i) => { |
| 160 | s.call(this, t, (t, s, r) => { |
| 161 | t ? i(t) : e(s) |
| 162 | }) |
| 163 | }) |
| 164 | } |
| 165 | get(t) { |
| 166 | return this.send.call(this.env, t) |
| 167 | } |