how to run a POST http request with parameter in nifi using processor invokeHTTP

Solution 1:

so you have this http request:

> POST /sparql HTTP/1.1
> User-Agent: curl/7.38.0
> Host: your-neptune-endpoint:8182
> Accept: */*
> Content-Length: 47
> Content-Type: application/x-www-form-urlencoded

you have to set at least following parameters for InvokeHttp nifi:

HTTP Method:         POST
Remote URL:          https://your-neptune-endpoint:8182/sparql
SSL Context Service: <...>
Content-Type:        application/x-www-form-urlencoded

Content-Type=application/x-www-form-urlencoded

is declaring that parameters will be passed in format a=v1 & b=v2 &...

the flowfile body could be set using GenerateFlowFile before InvokeHttp

query=select ?s ?p ?o where {?s ?p ?o} limit 10

note the unnecessary quote in body in your question

if your parameter value contains some special chars like = or & better to encode it in GenerateFlowFile:

query=${'select ?s ?p ?o where {?s ?p ?o} limit 10':urlEncode()}