Mounting url for test in cUrl

1

I'm using Retrofit to call an internal API from a site I'm testing. A url similar to the one I have is: www.sitedeteste.com/r/

In my Android retrofit I have this PUT statement:

@PUT("/ordem/{Id}/{tipo}")

In my Ubuntu terminal my url with cUrl is this:

curl -v -X PUT "http://www.sitedeteste.com/r/ordem/1/TO GO"

And tried other ways like:

curl -v -X PUT -d "Id=1&tipo=TO GO" http://www.sitedeteste.com/r/ordem/1/TO GO

But I'm not succeeding in the test. The error is always this:

* Connected to sitedeteste.com (---.---.---.---) port 80 (#0)
> PUT /r/ordem/1/TO GO HTTP/1.1
> Host: sitedeteste.com
> User-Agent: curl/7.50.1
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
* no chunk, no close, no size. Assume close to signal end
< 
* Closing connection 0

I do not know what to do to test? Am I going wrong at some point?

    
asked by anonymous 28.03.2017 / 02:04

1 answer

0

I think you have to change the space for the sign of + or %20 , that is between the / you should code, so do:

curl -v -X PUT -d "Id=1&tipo=TO%20GO" "http://www.sitedeteste.com/r/ordem/1/TO%20GO"

Or so:

curl -v -X PUT -d "Id=1&tipo=TO+GO" "http://www.sitedeteste.com/r/ordem/1/TO+GO"
    
28.03.2017 / 03:36