elhoucine
elhoucine

Reputation: 2426

What is the proper api url for this method?

I am consuming an api, the guy working in the backend uses c# and he could not explain to me the methods other than his code. But I don't have experience in c#. Can someone translate to me these lines and tell me what is the url part and what are the body params if any. Thanks!

[WebInvoke(Method = "POST",
        UriTemplate = "UploadCat/{token}/{BID}/{CID}/{CAT}/{DATA}")]
        public HttpResponse UploadCat(string token, string BID, string CID, string CAT, List<CLMobileChangeDTO> DATA) 

Upvotes: 2

Views: 55

Answers (1)

user8371558
user8371558

Reputation:

Depending on the encoding you could hit this API with curl like:

curl -X POST http://hostname/UploadCat/mytoken/myBID/myCID/myCAT/encodedDATA

The tricky part is how the framework you are using will encode a list of objects into URL safe characters to put it on the path. I don't think there is enough information in that code snippet to determine that.

Ideally you would use the post body to send List DATA instead of a path parameter.

Upvotes: 1

Related Questions