Closed livia1411 closed 7 years ago
Hard to tell without the spec itself. You can check the console and network tabs for more details.
Need more info to help
Hi @fehguy I am experiencing the same problem is it possible tp open this issue please. I have major issue as another developer has done this and left. so I need to check why POST is not working as expected!
When swagger is posting the object is always null. IF I change the content-type to content-type application/x-www-form-urlencoded I get the object parameters with null values still. Any helo would be good. I an working on ASP.net , ASP webapi.
please share the specification so we can help, without it there's nothing we can do. Many, many people use POST successfully so this is something specific to your situation, and that can only be guided with the json or yaml specification.
@fehguy Thanks you for the reply. I have webapicontroller method
public HttpResponseMessage Post([FromUri] long partnerId, [FromUri] long companyId, [FromBody] AddDriver driver) { ... }
the swagger works well for FromURI parameters but driver is always null and its a FromBody parameter. As I Said this is developed by some one and just left so I need to work with no much info. attached the api document screen shot.
I have tried changing the contentType to /x-www-form-urlencoded then the object Driver is recognized but all its properties are still null. I am using Fiddler to test this. Let me know if you need further info please.
@PvAsh we need the spec, not your code.
ok. the spec is I want to add a new car - driver to the system. created an object adddriver its a complex type. but when I post method and pass the parameters the Frombody parameter is always null. It should be what I have posted. Am I missing something here? Does that help.. :(
I am new to swagger and trying to figure out how to post things to the API. I do a get request to the API for originalName=Walmart and get the following format when I press "Try it out":
Next, I try to post something similar. So I copy the text above into the "post" box in the UI, change the authorId to 2, and press "Try it out". However, I get this:
Response Body
no content
Response Code
0
Response Headers
{ "error": "no response from server" } Any idea what could be going on? Thanks.