| | | 1 | | using Microsoft.AspNetCore.Http; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Http.Options; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Provides various options related to the HTTP activities. |
| | | 7 | | /// </summary> |
| | | 8 | | public class HttpActivityOptions |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// The root path at which HTTP activities can be invoked. |
| | | 12 | | /// </summary> |
| | 360 | 13 | | public PathString? BasePath { get; set; } = "/workflows"; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// The base URL of the server. This should be set to the same value at which the Elsa Server is publicly available. |
| | | 17 | | /// </summary> |
| | 15 | 18 | | public Uri BaseUrl { get; set; } = null!; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The prefix used for API routes. |
| | | 22 | | /// </summary> |
| | | 23 | | [Obsolete("Use ApiEndpointOptions from Elsa.Workflows.Api instead.")] |
| | 48 | 24 | | public string ApiRoutePrefix { get; set; } = "elsa/api"; |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// A configurable set of available content types available from the <see cref="WriteHttpResponse"/> activity. |
| | | 28 | | /// </summary> |
| | 49 | 29 | | public ISet<string> AvailableContentTypes { get; set; } = new SortedSet<string> |
| | 47 | 30 | | { |
| | 47 | 31 | | "application/json", |
| | 47 | 32 | | "application/xml", |
| | 47 | 33 | | "application/x-www-form-urlencoded", |
| | 47 | 34 | | "application/octet-stream", |
| | 47 | 35 | | "text/plain", |
| | 47 | 36 | | "text/html", |
| | 47 | 37 | | "text/json", |
| | 47 | 38 | | "text/xml", |
| | 47 | 39 | | }; |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// A boolean to opt-in if you want to call CompleteAsync() in the HttpResponse Activity |
| | | 43 | | /// and not waiting for the end of the HttpMiddleware. |
| | | 44 | | /// </summary> |
| | 63 | 45 | | public Boolean WriteHttpResponseSynchronously { get; set; } = false; |
| | | 46 | | } |