cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with "try it now" curl command

Contributor

Need help with "try it now" curl command

Hello everyone, currently I would like my "try it now" feature in my documentation set up in such a way that it displays the following curl command style. Currently our users are used to the following format where they provide source file link(Attribute-file.json) to create a bookmark. 

 

Our format. 

 

curl -k -H "Content-Type: application/json" -d @Attribute-File.json -X PUT https://myservername:7738/myserver/bookmark/fridaybookmark -H "Accept: application/json" -u sehgalu2

 

However,  when I click execute under "try it now", it gives out the following response only :

curl -X PUT "https://fr-s-hpcdm-uat-p.ncifcrf.gov/v2/dataObject/f/download" -H "accept: */*"

 

How can I edit my yaml so that it gives user an option to add that Attributes file as shown in my curl command above. 

Do i need to add another parameter or how to i achieve this task. Any help would be greatly appreciated. 

 

Thanks

 

 

1 REPLY 1
Highlighted
New Contributor

Re: Need help with "try it now" curl command

I suppose your swagger definition doesn't define any parameters.

You can take a look at some examples at the swagger spec page for a typical PUT operation (that has a body parameter) and for the basic authentication.

New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors