Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不推荐使用java/selenium的RESTAPI_Java_Rest_User Interface - Fatal编程技术网

不推荐使用java/selenium的RESTAPI

不推荐使用java/selenium的RESTAPI,java,rest,user-interface,Java,Rest,User Interface,我是这个网站的新手,但我希望能得到一些回复。 我正在使用java/selenium web驱动程序,并试图解决通过url发布API时遇到的一个问题 我试图通过url发送的命令(并将PatientID作为参数/变量)是: 我打算用Java/selenium代码来解决这个问题,如下所示: RestAssured.baseURI = "http://evdcvrtmbuild01:8040/modalities/Test101/find-study/{"PatientID ": "0555643F"

我是这个网站的新手,但我希望能得到一些回复。 我正在使用java/selenium web驱动程序,并试图解决通过url发布API时遇到的一个问题

我试图通过url发送的命令(并将PatientID作为参数/变量)是:

我打算用Java/selenium代码来解决这个问题,如下所示:

 RestAssured.baseURI = "http://evdcvrtmbuild01:8040/modalities/Test101/find-study/{"PatientID ": "0555643F"};
   RequestSpecification httpRequest = RestAssured.given();
        Response responseA = httpRequest.post("");
          String  body = responseA.getBody().asString();    
          System.out.println("BODY:" + body);
目前,我没有得到回应,因为我认为我没有得到url语法

有什么建议吗

谢谢,
上午

患者应该在身体里(如果你发帖子的话),而不是在url里

试着这样做:

RestAssured.baseURI = "http://evdcvrtmbuild01:8040/modalities/Test101/find-study/";
RequestSpecification httpRequest = RestAssured.given();
httpRequest.body("{\"PatientID \": \"0555643F\"}"); 
Response responseA = httpRequest.post("");
String  body = responseA.getBody().asString();    
System.out.println("BODY:" + body);

我尝试了上述操作,但在线程“main”java.lang.IllegalArgumentException中得到:Exception:路径参数数无效。预期为1,实际为0。未定义的路径参数为:“PatientID”:“0555643F”。位于java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法),位于java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(未知源),位于java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance,位于java.base/java.lang.reflector.newInstance(未知源Hi Tom,在重新测试后,我得到以下错误:log4j:WARN找不到记录器(org.apache.http.impl.conn.BasicClientConnectionManager)的附加程序。log4j:WARN请正确初始化log4j系统。正文:{“HttpError”:“内部服务器错误”,“HttpStatus”:500,“消息”:“未知DICOM标记”,“方法”:“POST”,“或错误”:“未知DICOM标记”,“或错误状态”:27,“Uri”:“/modules/Test101/find study/”}
RestAssured.baseURI = "http://evdcvrtmbuild01:8040/modalities/Test101/find-study/";
RequestSpecification httpRequest = RestAssured.given();
httpRequest.body("{\"PatientID \": \"0555643F\"}"); 
Response responseA = httpRequest.post("");
String  body = responseA.getBody().asString();    
System.out.println("BODY:" + body);