X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.rest%2Fscl%2FHTTP%2FClient.scl;h=6568116c9e6a5d9c496e45e16b9b06e5075b1bde;hb=refs%2Fchanges%2F08%2F1808%2F1;hp=34fc6a77edcb620f96b3a4ceff0e1014cd447c78;hpb=0edd88ddfb4c73f2689dd3b504be01209b74a32c;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.rest/scl/HTTP/Client.scl b/bundles/org.simantics.scl.rest/scl/HTTP/Client.scl index 34fc6a77e..6568116c9 100644 --- a/bundles/org.simantics.scl.rest/scl/HTTP/Client.scl +++ b/bundles/org.simantics.scl.rest/scl/HTTP/Client.scl @@ -24,6 +24,8 @@ importJava "javax.ws.rs.core.Response" where @Private @JavaName readEntity readEntity_ :: Response -> Class a -> a + @JavaName getHeaderString + possibleHeaderOf :: Response -> String -> Maybe String readEntity :: VecComp a => Response -> a readEntity response = readEntity_ response classObject @@ -73,9 +75,13 @@ importJava "javax.ws.rs.client.ClientBuilder" where clientBuilder :: ClientBuilder importJava "org.simantics.scl.rest.HttpClientUtils" where - buildClient :: ClientBuilder -> Client + buildClient :: ClientBuilder -> Client statusMessageOf :: Response -> String asyncInvoke :: Invocation -> ResponseHandler -> FailureHandler -> Future Response + trustAllClientBuilder :: ClientBuilder + onReadProgress :: WebTarget -> (Long -> ()) -> () + onWriteProgress :: WebTarget -> (Long -> ()) -> () + possibleContentLengthOf :: Response -> Maybe Long importJava "javax.ws.rs.client.Entity" where data Entity @@ -132,7 +138,6 @@ postFileExample uri f = do webTarget = target httpClient uri builder = request webTarget acceptMediaType builder [WILDCARD_TYPE] - mp = formDataMultiPart invocation = buildPost builder $ entity f APPLICATION_OCTET_STREAM_TYPE response = syncInvoke invocation print $ statusCodeOf response