[GitHub] satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example
satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example URL: https://github.com/apache/flink/pull/6706#discussion_r218899758 ## File path: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHeaders.java ## @@ -73,7 +73,7 @@ public static JarUploadHeaders getInstance() { public String getDescription() { return "Uploads a jar to the cluster. The jar must be sent as multi-part data. Make sure that the \"Content-Type\"" + " header is set to \"application/x-java-archive\", as some http libraries do not add the header by default.\n" + - "Using 'curl' you can upload a jar via 'curl -X POST -H \"Expect:\" -F \"jarfile=#path/to/flink-job.jar\" http://hostname:port; + URL + "'."; + "Using 'curl' you can upload a jar via 'curl -X POST -F \"jarfile=@path/to/flink-job.jar;type=application/x-java-archive\" http://hostname:port; + URL + "'."; Review comment: @GJL thank you for the feedback. agree, it's Content-Type comment is quite confusing. Indeed Flink(1.6.0) doesn't need to set `content-type`, curl works without it. I'll update curl example to substitute # => @ symbols in this case. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 With regards, Apache Git Services
[GitHub] satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example
satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example URL: https://github.com/apache/flink/pull/6706#discussion_r218568646 ## File path: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHeaders.java ## @@ -73,7 +73,7 @@ public static JarUploadHeaders getInstance() { public String getDescription() { return "Uploads a jar to the cluster. The jar must be sent as multi-part data. Make sure that the \"Content-Type\"" + " header is set to \"application/x-java-archive\", as some http libraries do not add the header by default.\n" + - "Using 'curl' you can upload a jar via 'curl -X POST -H \"Expect:\" -F \"jarfile=#path/to/flink-job.jar\" http://hostname:port; + URL + "'."; + "Using 'curl' you can upload a jar via 'curl -X POST -F \"jarfile=@path/to/flink-job.jar;type=application/x-java-archive\" http://hostname:port; + URL + "'."; Review comment: In the description, it says the client needs to set `Content-Type`. However, if content-type specified in the header via `-H` the request doesn't work. I've got from curl man how to specify content-type with the multipart upload. ``` You can also tell curl what Content-Type to use by using 'type=', in a manner similar to: curl -F "web=@index.html;type=text/html" url.com ``` After I've changed the example with `type=` it uploaded the jar. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 With regards, Apache Git Services
[GitHub] satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example
satybald commented on a change in pull request #6706: [hotfix][doc] Fix curl example in upload jar example URL: https://github.com/apache/flink/pull/6706#discussion_r218568646 ## File path: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHeaders.java ## @@ -73,7 +73,7 @@ public static JarUploadHeaders getInstance() { public String getDescription() { return "Uploads a jar to the cluster. The jar must be sent as multi-part data. Make sure that the \"Content-Type\"" + " header is set to \"application/x-java-archive\", as some http libraries do not add the header by default.\n" + - "Using 'curl' you can upload a jar via 'curl -X POST -H \"Expect:\" -F \"jarfile=#path/to/flink-job.jar\" http://hostname:port; + URL + "'."; + "Using 'curl' you can upload a jar via 'curl -X POST -F \"jarfile=@path/to/flink-job.jar;type=application/x-java-archive\" http://hostname:port; + URL + "'."; Review comment: In the description, it says the client needs to set `Content-Type`. However, if content-type specified in the header via `-H` the request doesn't work. curl man docs say how to specify content-type with the multipart upload. ``` You can also tell curl what Content-Type to use by using 'type=', in a manner similar to: curl -F "web=@index.html;type=text/html" url.com ``` After I've changed the example with `type=` it uploaded the jar. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 With regards, Apache Git Services