Kelly-ZH opened a new issue, #16631:
URL: https://github.com/apache/pulsar/issues/16631

   Hello, I met an error which needs help. I am looking forward someone can 
answer it, thank you.
   I create function which string like 
   
`{"runtimeFlags":"","tenant":"public","namespace":"default","name":"PublishFunction","className":"org.apache.pulsar.functions.api.examples.PublishFunction","inputs":["persistent://public/default/function-input-topic"],"customSerdeInputs":{},"topicsPattern":"","customSchemaInputs":{},"customSchemaOutputs":{},"inputSpecs":{"persistent://public/default/function-input-topic":{"schemaType":"","serdeClassName":"","schemaProperties":{},"consumerProperties":{},"receiverQueueSize":0,"cryptoConfig":{},"poolMessages":true,"regexPattern":true}},"output":"persistent://public/default/function-output-topic","producerConfig":{"maxPendingMessages":0,"maxPendingMessagesAcrossPartitions":0,"useThreadLocalProducers":true,"cryptoConfig":{},"batchBuilder":""},"outputSchemaType":"","outputSerdeClassName":"","logTopic":"","processingGuarantees":"ATLEAST_ONCE","retainOrdering":true,"retainKeyOrdering":true,"batchBuilder":"","forwardSourceMessageProperty":true,"userConfig":{},"secrets":{},"runtime":"JAVA",
 "autoAck":true,"maxMessageRetries":0,"deadLetterTopic ":"","subName 
":"","parallelism ":2,"resources ":{"cpu ":1.0,"ram ":1073741824,"disk 
":10737418240},"fqfn ":"","windowConfig ":{},"timeoutMs ":0,"jar 
":"/opt/cloud/GEMASPulsar/apache-pulsar-2.10.0/examples/api-examples.jar","py 
":"","go ":"","cleanupSubscription ":true,"customRuntimeOptions 
":"","maxPendingAsyncRequests ":0,"exposePulsarAdminClientEnabled 
":true,"subscriptionPosition ":"Latest "}`, I also try make above string as a 
json file, but it doesn't work; Then I set Content-Type as application/json or 
"multipart/form-data".
   
   the detail error is bellow:
   `Note: Unnecessary use of -X or --request, POST is already inferred.
   *   Trying 10.172.167.163:8080...
   * Connected to 10.172.167.163 (10.172.167.163) port 8080 (#0)
   > POST /admin/v3/functions/public/default/PublishFunction HTTP/1.1
   > Host: 10.172.167.163:8080
   > User-Agent: curl/7.69.1
   > Accept: */*
   > Content-Type: application/json;charset=utf-8
   > Content-Length: 1447
   > 
   * upload completely sent off: 1447 out of 1447 bytes
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 415 Unsupported Media Type
   < Date: Sat, 16 Jul 2022 11:05:25 GMT
   < Cache-Control: must-revalidate,no-cache,no-store
   < Content-Type: text/html;charset=iso-8859-1
   < Server: Jetty(9.4.43.v20210629)
   < Content-Length: 579
   < 
   <html>
   <head>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
   <title>Error 415 Unsupported Media Type</title>
   </head>
   <body><h2>HTTP ERROR 415 Unsupported Media Type</h2>
   <table>
   
<tr><th>URI:</th><td>/admin/v3/functions/public/default/PublishFunction</td></tr>
   <tr><th>STATUS:</th><td>415</td></tr>
   <tr><th>MESSAGE:</th><td>Unsupported Media Type</td></tr>
   
<tr><th>SERVLET:</th><td>org.glassfish.jersey.servlet.ServletContainer-70a24463</td></tr>
   </table>
   <hr><a href="https://eclipse.org/jetty";>Powered by Jetty:// 
9.4.43.v20210629</a><hr/>
   
   </body>
   </html>
   `
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to