403 Response in Swagger but curl from the command line returns fine

2,520 views
Skip to first unread message

sgrant

unread,
Nov 18, 2015, 11:19:19 AM11/18/15
to Swagger
When I execute a call from within the swagger UI I get a 403 response.  When i take the generated curl string and execute from the command line it returns fine.  This happens to be an https PUT and seems specific to PUT.  Does anyone have any thoughts as to why this would be happening?  Actually between various programmatic calls and clients we have about 50/50 split of 403 responses and 200s from the same call like this.  For example, Postman gives a 403 but Paws return 200 and a body.  Would really appreciate any input.

tony tam

unread,
Nov 18, 2015, 11:24:01 AM11/18/15
to swagger-sw...@googlegroups.com
Can you please grab the debug info from your browser and share it?

On Nov 18, 2015, at 10:19 AM, sgrant <stvh...@gmail.com> wrote:

When I execute a call from within the swagger UI I get a 403 response.  When i take the generated curl string and execute from the command line it returns fine.  This happens to be an https PUT and seems specific to PUT.  Does anyone have any thoughts as to why this would be happening?  Actually between various programmatic calls and clients we have about 50/50 split of 403 responses and 200s from the same call like this.  For example, Postman gives a 403 but Paws return 200 and a body.  Would really appreciate any input.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sgrant

unread,
Nov 18, 2015, 11:31:38 AM11/18/15
to Swagger
"Failed to load resource: the server responded with a status of 403 (Forbidden)"

PUT https://show.oasmr.com/data_entry/rest/clients/37796 403 (Forbidden)Request.end @ index.js:24SuperagentHttpClient.execute @ schema-markup.js:201SwaggerHttp.execute @ schema-markup.js:69Operation.execute @ index.js:633SwaggerUi.Views.OperationView.Backbone.View.extend.submitOperation @ index.js:24p.event.dispatch @ jquery-1.8.0.min.js:2g.handle.h @ jquery-1.8.0.min.js:2

Is there some other debug info you need?

Swagger response headers:

{
"date": "Wed, 18 Nov 2015 02:43:52 GMT",
"content-encoding": "gzip",
"allow": "POST, GET, OPTIONS, PUT, DELETE",
"vary": "Accept-Encoding",
"access-control-allow-methods": "POST, GET, OPTIONS, PUT, DELETE",
"content-type": "text/plain;charset=UTF-8",
"access-control-allow-origin": "*",
"access-control-expose-headers": "Authorization,Access-Control-Allow-Origin,Access-Control-Allow-Credentials, Authorization,Access-Control-Allow-Origin,Access-Control-Allow-Credentials",
"access-control-allow-credentials": "true",
"connection": "Keep-Alive",
"keep-alive": "timeout=5, max=100, timeout=5, max=100",
"content-length": "20"
}
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron

unread,
Dec 1, 2015, 3:41:06 PM12/1/15
to Swagger

Does your API call require authentication to be executed?

Can you provide the output of curl -I https://show.oasmr.com/data_entry/rest/clients/37796?

When I try it, I get 401.

Reply all
Reply to author
Forward
0 new messages