sijie commented on issue #6809:
URL: https://github.com/apache/pulsar/issues/6809#issuecomment-618703430


   @qmnonic 
   
   The `v2` endpoint still takes a serialized json string of FunctionConfig:  
`/admin/v3/functions/{tenant}/{namespace}/{functionName} `
   
   There was a change in 2.5.0/2.4.1 - changing `v3` endpoint was changed to be 
a more structured way for uploading a FunctionConfig. 
   
   What you basically need to add in the post payload is to make sure the 
`functionConfig` is a JSON  payload in the form data.
   
   I think what you can do in python:
   
   ```
   mp_encoder = MultipartEncoder(
           fields={
               'url': 
'file://pulsar/lib/org.apache.pulsar-pulsar-functions-api-examples-2.5.1.jar',
               'functionConfig': (None, json.dumps({ 'tenant': 'example'}), 
'application/json')
           }
       )
       headers = {'Content-Type': mp_encoder.content_type}
        response = requests.post(api_url, data=mp_encoder, headers=headers)
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to