Search in sources :

Example 1 with Params

use of org.apache.jena.sparql.engine.http.Params in project jena by apache.

the class TestHttpOp method httpPost_04.

@Test
public void httpPost_04() {
    Params params = new Params();
    params.addParam("query", "ASK{}");
    TypedInputStream in = HttpOp.execHttpPostFormStream(queryURL, params, WebContent.contentTypeResultsJSON);
    IO.close(in);
}
Also used : Params(org.apache.jena.sparql.engine.http.Params) TypedInputStream(org.apache.jena.atlas.web.TypedInputStream) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 2 with Params

use of org.apache.jena.sparql.engine.http.Params in project jena by apache.

the class TestHttpOp method httpPost_06.

@Test
public void httpPost_06() {
    Params params = new Params().addParam("request", "CLEAR ALL");
    HttpOp.execHttpPostForm(updateURL, params);
}
Also used : Params(org.apache.jena.sparql.engine.http.Params) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest)

Example 3 with Params

use of org.apache.jena.sparql.engine.http.Params in project jena by apache.

the class TestHttpOp method httpPost_05.

public void httpPost_05() {
    Params params = new Params().addParam("query", "ASK{}");
    // Query to Update
    execWithHttpException(HttpSC.BAD_REQUEST_400, () -> HttpOp.execHttpPostFormStream(updateURL, params, WebContent.contentTypeResultsJSON));
}
Also used : Params(org.apache.jena.sparql.engine.http.Params)

Example 4 with Params

use of org.apache.jena.sparql.engine.http.Params in project jena by apache.

the class UpdateProcessRemoteForm method execute.

@Override
public void execute() {
    // Validation
    if (this.getEndpoint() == null)
        throw new ARQException("Null endpoint for remote update by form");
    if (this.getUpdateRequest() == null)
        throw new ARQException("Null update request for remote update");
    // Execution
    String reqStr = this.getUpdateRequest().toString();
    Params ps = new Params(this.getParams());
    ps.addParam(HttpParams.pUpdate, reqStr);
    execHttpPostForm(this.getEndpoint(), ps, null, HttpResponseLib.nullResponse, getClient(), getHttpContext());
}
Also used : ARQException(org.apache.jena.sparql.ARQException) HttpParams(org.apache.jena.sparql.engine.http.HttpParams) Params(org.apache.jena.sparql.engine.http.Params)

Aggregations

Params (org.apache.jena.sparql.engine.http.Params)4 BaseTest (org.apache.jena.atlas.junit.BaseTest)1 TypedInputStream (org.apache.jena.atlas.web.TypedInputStream)1 AbstractFusekiTest (org.apache.jena.fuseki.AbstractFusekiTest)1 ARQException (org.apache.jena.sparql.ARQException)1 HttpParams (org.apache.jena.sparql.engine.http.HttpParams)1 Test (org.junit.Test)1