MCPcopy Create free account
hub / github.com/apache/mesos / post

Method post

src/tests/agent_container_api_tests.cpp:115–130  ·  view source on GitHub ↗

Helper function to post a request to the `/api/v1` agent endpoint and return the response.

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

createBasicAuthHeadersFunction · 0.85
postFunction · 0.70
stringifyFunction · 0.50
serializeFunction · 0.50

Tested by

no test coverage detected