MCPcopy Create free account
hub / github.com/bdring/FluidNC / value

Method value

FluidNC/src/WebUI/HttpCommand.cpp:173–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 void HttpOptionsListener::value(String value) {
174 if (_depth == 1) {
175 // Top-level values
176 if (_currentKey == "method") {
177 _request.method = value.c_str();
178 } else if (_currentKey == "timeout") {
179 int timeout = value.toInt();
180 _request.timeout_ms = std::min(static_cast<uint32_t>(timeout), HttpCommand::MAX_TIMEOUT_MS);
181 } else if (_currentKey == "body") {
182 _request.body = value.c_str();
183 // Default to POST if body is present and method not set
184 if (_request.method == "GET") {
185 _request.method = "POST";
186 }
187 } else if (_currentKey == "halt_on_error") {
188 // "halt_on_error":true (default) = halt GCode on error, "halt_on_error":false = continue
189 _request.fail_on_error = (value == "true" || value == "1");
190 }
191 } else if (_depth == 2) {
192 // Nested object values (headers or extract)
193 if (_inHeaders && !_nestedKey.isEmpty()) {
194 _request.headers[_nestedKey.c_str()] = value.c_str();
195 } else if (_inExtract && !_nestedKey.isEmpty()) {
196 _request.extract[_nestedKey.c_str()] = value.c_str();
197 }
198 }
199 }
200
201 void HttpOptionsListener::startObject() {
202 _depth++;

Callers 15

TestFunction · 0.45
getSessionCookieMethod · 0.45
myStreamFileMethod · 0.45
handle_rootMethod · 0.45
getPageidMethod · 0.45
_handle_web_commandMethod · 0.45
fileUploadMethod · 0.45
WebUpdateUploadMethod · 0.45
handleFileOpsMethod · 0.45
isMacOSMethod · 0.45
acceptsEncodingMethod · 0.45
acceptsTypeMethod · 0.45

Calls 8

set_named_paramFunction · 0.85
c_strMethod · 0.80
toIntMethod · 0.80
isEmptyMethod · 0.80
toFloatMethod · 0.80
eraseMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by 3

TestFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36