support for non GET methods. Closes #15

This commit is contained in:
Ayush Gupta
2012-07-17 18:31:38 -07:00
parent f42a3bf687
commit f2e63c65a7
14 changed files with 239 additions and 37 deletions

View File

@@ -32,8 +32,18 @@ You may choose to customize Swagger UI for your organization. Here is an overvie
- src/main/html: the html files, some images and css
- src/main/javascript: some legacy javascript referenced by CofffeeScript code
### HTTP Methods and API Invocation
swagger-ui supports invocation of all HTTP methods APIs but only GET methods APIs are enabled by default. You can choose to enable other HTTP methods like POST, PUT and DELETE. This can be enabled by setting the supportedSubmitMethods parameter when creating SwaggerUI instance.
For example if you wanted to enable GET, POST and PUT but not for DELETE, you'd set this as:
```supportedSubmitMethods: ['get', 'post', 'put']
```
_Note that for POST/PUT body, you'd need to paste in the request data in an appropriate format which your service can unmarshall_
### Header Parameters
Because of [Cross-Origin Resource Sharing](http://www.w3.org/TR/cors/) restrictions, swagger-ui, by default, does not send header parameters. This can be enabled by [setting the supportHeaderParams to false when creating SwaggerUI instance](https://github.com/wordnik/swagger-ui/blob/overhaul/src/main/html/index.html#L45).
header parameters aere supported. However because of [Cross-Origin Resource Sharing](http://www.w3.org/TR/cors/) restrictions, swagger-ui, by default, does not send header parameters. This can be enabled by [setting the supportHeaderParams to false when creating SwaggerUI instance](https://github.com/wordnik/swagger-ui/blob/overhaul/src/main/html/index.html#L45).