Mounting url for testing in Curl

Asked

Viewed 285 times

1

I’m using Retrofit to call an internal API from a site I’m testing. A url similar to the one I own is this: 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 I tried in other ways:

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 mistake 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 don’t know what else to do to test it? I’m getting it wrong at some point?

1 answer

0


I guess I’ll have to change the space for the + or %20, or between the / you must code, do so:

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"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.