Class RequestMessage
Properties and base methods to all request messages.
Inheritance
System.Object
RequestMessage
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StoneCo.Framework.Services
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public class RequestMessage
Constructors
RequestMessage()
Default constructor.
Declaration
public RequestMessage()
Properties
DefaultRequestHeaders
Default request headers.
Declaration
public IDictionary<string, string> DefaultRequestHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | content-type: text/plain |
Tracekey
Key of trace.
Declaration
public string Tracekey { get; set; }
Property Value
Type | Description |
---|---|
System.String | Sample a4477c7f88264bc1973e55856c8cfbd2 |
Methods
AddHeader(String, String)
Add or update items in the header.
If the value is null or empty, the item will not be added or updated in the header.
Declaration
public RequestMessage AddHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to identify value on header. |
System.String | value | Value that represents the key on header. |
Returns
Type | Description |
---|---|
RequestMessage |
Examples
Bar class used in this example.
public class Bar
{
public void SetHeader()
{
var request = new FooMessageRequest();
request.AddHeader(Headers.Tracekey, Guid.NewGuid().ToString("N"));
}
}
GetHeader(String)
Get header value by the key.
Declaration
public string GetHeader(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to identify value on header. |
Returns
Type | Description |
---|---|
System.String | Value that represents the key on header. |
Examples
Bar class used in this example.
public class Bar
{
public void GetHeader()
{
var request = new FooMessageRequest();
var valueOfheader = request.GetHeader(Headers.Tracekey);
}
}