2

I'm trying to post a trace to a remote machine by giving the trace path and name as parameters in the curl command like this:

sshpass -p password ssh username@ip_adress "curl -X POST -d '{"parameters":{"name":"trace","uri":"/usagers4/username/Documents/Bench_1/kernel"}}' http://0.0.0.0:8080/tsp/api/traces -H Accept:application/json -H Content-Type:application/json"

But I'm getting the following error:

javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('p' (code 112)): was expecting double-quote to start field name| at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 3]

Does anyone have an idea about what I'm doing wrong ?

Thanks

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Abrahe
  • 21
  • 1

1 Answers1

0

I Solved! i'm need to get out for python use os.system(Curl ... ) it command return code 112 double quote to start field name i'm use os.system("curl -d '{\"agr\" : value}' -H 'value' -H 'value' ... etc.") you should use the following code

"curl -X POST -d '{\"parameters\":{\"name\":\"trace\",\"uri\":\"/usagers4/username/Documents/Bench_1/kernel\"}}' http://0.0.0.0:8080/tsp/api/traces -H 'Accept:application/json' -H 'Content-Type:application/json'"
Hack Lag
  • 1
  • 1