We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multipart/form-data
POSTing a multipart/form-data to /api/v2/rules always produces an HTTP 415 error response.
/api/v2/rules
The rule should be created whether submitted as multipart/form-data, application/x-www-form-urlencoded, or application/json.
application/x-www-form-urlencoded
application/json
Related to https://github.com/cryostatio/cryostat/pull/1072
sh run.sh
$ curl -vk -F name="firstRule" -F matchExpression="target.labels[\"app\"]==\"jfr-sb-app\"" -F eventSpecifier="template=Profiling,type=TARGET" https://localhost:8181/api/v2/rules -H 'Accept: application/json' -H 'Content-Type: multipart/form-data' * Trying 127.0.0.1:8181... * Connected to localhost (127.0.0.1) port 8181 (#0) * ALPN: offers h2 * ALPN: offers http/1.1 * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS header, Finished (20): * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS header, Finished (20): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN: server did not agree on a protocol. Uses default. * Server certificate: * subject: C=CA; O=Cryostat; CN=cryostat * start date: Feb 2 02:03:33 2023 GMT * expire date: Feb 2 02:03:33 2024 GMT * issuer: C=CA; O=Cryostat; CN=cryostat * SSL certificate verify result: self-signed certificate (18), continuing anyway. * TLSv1.2 (OUT), TLS header, Supplemental data (23): > POST /api/v2/rules HTTP/1.1 > Host: localhost:8181 > User-Agent: curl/7.85.0 > Accept: application/json > Content-Length: 419 > Content-Type: multipart/form-data; boundary=------------------------1b58d77f95f35fe9 > * TLSv1.2 (OUT), TLS header, Supplemental data (23): * We are completely uploaded and fine * TLSv1.2 (IN), TLS header, Supplemental data (23): * Mark bundle as not supporting multiuse < HTTP/1.1 415 Unsupported Media Type < content-type: application/json < content-length: 87 < * Connection #0 to host localhost left intact {"meta":{"type":"text/plain","status":"Unsupported Media Type"},"data":{"reason":null}}
$ curl -vk -d name="firstRule" -d matchExpression="target.labels[\"app\"]==\"jfr-sb-app\"" -d eventSpecifier="template=Profiling,type=TARGET" https://localhost:8181/api/v2/rules -H 'Accept: application/json' * Trying 127.0.0.1:8181... * Connected to localhost (127.0.0.1) port 8181 (#0) * ALPN: offers h2 * ALPN: offers http/1.1 * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS header, Finished (20): * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS header, Finished (20): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN: server did not agree on a protocol. Uses default. * Server certificate: * subject: C=CA; O=Cryostat; CN=cryostat * start date: Feb 2 02:03:33 2023 GMT * expire date: Feb 2 02:03:33 2024 GMT * issuer: C=CA; O=Cryostat; CN=cryostat * SSL certificate verify result: self-signed certificate (18), continuing anyway. * TLSv1.2 (OUT), TLS header, Supplemental data (23): > POST /api/v2/rules HTTP/1.1 > Host: localhost:8181 > User-Agent: curl/7.85.0 > Accept: application/json > Content-Length: 111 > Content-Type: application/x-www-form-urlencoded > * TLSv1.2 (IN), TLS header, Supplemental data (23): * Mark bundle as not supporting multiuse < HTTP/1.1 201 Created < location: /api/v2/rules/firstRule < content-type: application/json < content-length: 85 < * Connection #0 to host localhost left intact {"meta":{"type":"application/json","status":"Created"},"data":{"result":"firstRule"}}
$ curl -vk -H 'Content-Type: application/json' -d '{"name":"secondRule","matchExpression":"false","eventSpecifier":"template=Profiling,type=TARGET"}' https://localhost:8181/api/v2/rules -H 'Accept: application/json' * Trying 127.0.0.1:8181... * Connected to localhost (127.0.0.1) port 8181 (#0) * ALPN: offers h2 * ALPN: offers http/1.1 * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS header, Finished (20): * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS header, Finished (20): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN: server did not agree on a protocol. Uses default. * Server certificate: * subject: C=CA; O=Cryostat; CN=cryostat * start date: Feb 2 02:03:33 2023 GMT * expire date: Feb 2 02:03:33 2024 GMT * issuer: C=CA; O=Cryostat; CN=cryostat * SSL certificate verify result: self-signed certificate (18), continuing anyway. * TLSv1.2 (OUT), TLS header, Supplemental data (23): > POST /api/v2/rules HTTP/1.1 > Host: localhost:8181 > User-Agent: curl/7.85.0 > Content-Type: application/json > Accept: application/json > Content-Length: 97 > * TLSv1.2 (IN), TLS header, Supplemental data (23): * Mark bundle as not supporting multiuse < HTTP/1.1 201 Created < location: /api/v2/rules/secondRule < content-type: application/json < content-length: 86 < * Connection #0 to host localhost left intact {"meta":{"type":"application/json","status":"Created"},"data":{"result":"secondRule"}}
The text was updated successfully, but these errors were encountered:
aali309
Successfully merging a pull request may close this issue.
Current Behavior:
POSTing a
multipart/form-data
to/api/v2/rules
always produces an HTTP 415 error response.Expected Behavior:
The rule should be created whether submitted as
multipart/form-data
,application/x-www-form-urlencoded
, orapplication/json
.Related to https://github.com/cryostatio/cryostat/pull/1072
Steps To Reproduce:
sh run.sh
The text was updated successfully, but these errors were encountered: