Helper function to post a request to the `/api/v1` agent endpoint and return the response.
| 113 | // Helper function to post a request to the `/api/v1` agent endpoint |
| 114 | // and return the response. |
| 115 | Future<http::Response> post( |
| 116 | const process::PID<slave::Slave>& pid, |
| 117 | const v1::agent::Call& call) |
| 118 | { |
| 119 | ContentType contentType = std::get<2>(GetParam()); |
| 120 | |
| 121 | http::Headers headers = createBasicAuthHeaders(DEFAULT_CREDENTIAL); |
| 122 | headers["Accept"] = stringify(contentType); |
| 123 | |
| 124 | return http::post( |
| 125 | pid, |
| 126 | "api/v1", |
| 127 | headers, |
| 128 | serialize(contentType, call), |
| 129 | stringify(contentType)); |
| 130 | } |
| 131 | |
| 132 | // Helper function to deserialize the response from the `/api/v1` agent |
| 133 | // endpoint as a V1 response protobuf. |
nothing calls this directly
no test coverage detected