-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Expected Behavior
calling .AddObject(obj)
on a RestRequest
would create parameters with names serialized by rules of the JsonProperty
or other naming attributes of the property
Actual Behavior
Adds parameter with name of property
Steps to Reproduce the Problem
public class MyClass {
[JsonProperty("created_at")]
public DateTime CreatedOn { get; set; }
}
Request:
var req = new RestRequest("url");
req.AddObject(new MyClass { CreatedOn = DateTime.Now } );
This results in a query string parameter of "CreatedOn" instead of "created_at"
Specifications
Attributes JsonAttribute("created_at")
, XmlElement(ElementName = "created_at")
, or a new attribute like SerializeAs
, (etc.?) would create query string parameters using the names specified in the serialization attributes.
monty241