Skip to content

Commit ce79903

Browse files
(AzureCXP) MicrosoftDocs/azure-docs#30150
Fixing <content-type> shall be "Content-Type: application/json"
1 parent e947b2d commit ce79903

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/hdinsight/spark/apache-spark-livy-rest-interface.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ You can use Livy to run interactive Spark shells or submit batch jobs to be run
2424
## Submit an Apache Livy Spark batch job
2525
Before you submit a batch job, you must upload the application jar on the cluster storage associated with the cluster. You can use [**AzCopy**](../../storage/common/storage-use-azcopy.md), a command-line utility, to do so. There are various other clients you can use to upload data. You can find more about them at [Upload data for Apache Hadoop jobs in HDInsight](../hdinsight-upload-data.md).
2626

27-
curl -k --user "<hdinsight user>:<user password>" -v -H <content-type> -X POST -d '{ "file":"<path to application jar>", "className":"<classname in jar>" }' 'https://<spark_cluster_name>.azurehdinsight.net/livy/batches' -H "X-Requested-By: admin"
27+
curl -k --user "<hdinsight user>:<user password>" -v -H "Content-Type: application/json" -X POST -d '{ "file":"<path to application jar>", "className":"<classname in jar>" }' 'https://<spark_cluster_name>.azurehdinsight.net/livy/batches' -H "X-Requested-By: admin"
2828

2929
**Examples**:
3030

3131
* If the jar file is on the cluster storage (WASB)
3232

33-
curl -k --user "admin:mypassword1!" -v -H 'Content-Type: application/json' -X POST -d '{ "file":"wasb://mycontainer@mystorageaccount.blob.core.windows.net/data/SparkSimpleTest.jar", "className":"com.microsoft.spark.test.SimpleFile" }' "https://mysparkcluster.azurehdinsight.net/livy/batches" -H "X-Requested-By: admin"
33+
curl -k --user "admin:mypassword1!" -v -H "Content-Type: application/json" -X POST -d '{ "file":"wasb://mycontainer@mystorageaccount.blob.core.windows.net/data/SparkSimpleTest.jar", "className":"com.microsoft.spark.test.SimpleFile" }' "https://mysparkcluster.azurehdinsight.net/livy/batches" -H "X-Requested-By: admin"
3434
* If you want to pass the jar filename and the classname as part of an input file (in this example, input.txt)
3535

3636
curl -k --user "admin:mypassword1!" -v -H "Content-Type: application/json" -X POST --data @C:\Temp\input.txt "https://mysparkcluster.azurehdinsight.net/livy/batches" -H "X-Requested-By: admin"

0 commit comments

Comments
 (0)