(method, url, body = "")
| 43 | |
| 44 | } |
| 45 | async taskRequest(method, url, body = "") { |
| 46 | // |
| 47 | let headers = { |
| 48 | "user-agent": "Dart/2.19 (dart:io)", |
| 49 | "x-app-id": "fVbEaznM", |
| 50 | "service-version": "2.16.5", |
| 51 | "accept-encoding": "gzip", |
| 52 | "aid": this.aid, |
| 53 | "content-type": "application/json", |
| 54 | "signinsource": "client_ios", |
| 55 | "version": "", |
| 56 | //"content-length": "33", |
| 57 | "rid": this.rid, |
| 58 | "host": "api-gateway.livanauto.com", |
| 59 | "x-timestamp": Date.now(), |
| 60 | "x-sequence-no": "q193JPARcnfIVizYzt3IZ" |
| 61 | } |
| 62 | const reqeuestOptions = { |
| 63 | url: url, |
| 64 | method: method, |
| 65 | headers: headers |
| 66 | } |
| 67 | if (method !== "get") { |
| 68 | if (headers["Content-Type"] == "application/json") { |
| 69 | reqeuestOptions["body"] = JSON.stringify(body); |
| 70 | } else { |
| 71 | reqeuestOptions["body"] = body |
| 72 | } |
| 73 | } |
| 74 | let { body: result } = await $.httpRequest(reqeuestOptions) |
| 75 | return result |
| 76 | } |
| 77 | async essay_list() { |
| 78 | let result = await this.taskRequest("get", `https://api-gateway.livanauto.com/app/v1.0/appapi/content/subject/appSubject?current=1&subjectId=36&essayCurrent=1&pageSize=20`) |
| 79 | if (result.code == 0) { |
no test coverage detected