servicex-sh / httpx

httpx - CLI to test HTTP/gRPC/RSocket/Kafka... services by HTTP DSL
https://servicex.sh
Apache License 2.0
132 stars 9 forks source link

Problem to save files #16

Open linux-china opened 2 years ago

linux-china commented 2 years ago

@ssokolov1 is running a command in testing directory where file test-api-retention.http is located and there is a subfolder resources

httpx -f rest-api-retention.http -p docker -a

### Download random logo to use as attachment to the file
GET {{logo}}

>>! resources/logo.png

2022-10-10 11:04:07.103 ERROR 29167 --- [ main] org.mvnsearch.http.HttpxCommand : HTX-002-500 - Failed to parse http code!

java.nio.file.FileSystemException: rest-api-retention.http/resources/logo.png: Not a directory at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218) ~[httpx:na]

Here is the problem. It is trying to append script name to the current path, what is wrong in my opinion as rest-api-retention.http is a file, not a directory. IntelliJ internal runner handles it correctly. I can create a new issue if it helps. And one more time, thank you for your great work.

linux-china commented 2 years ago

@ssokolov1 I commented logic to write response body to file because quarantine check by Mac. The feature to write response body to file is not available now.

https://github.com/servicex-sh/httpx/blob/deb8e8296f0342216462fcd1b167f7e4462e5938/src/main/java/org/mvnsearch/http/HttpxCommand.java#L398

image

2022-10-10 11:04:07.103 ERROR 29167 --- [ main] org.mvnsearch.http.HttpxCommand : HTX-002-500 - Failed to parse http code!

I think it was caused by http file format because failed to parse http code. Could you move following code to another http file and test it again?

### Download random logo to use as attachment to the file
GET {{logo}}

>>! resources/logo.png