|
| 1 | +using System; |
| 2 | +using System.Runtime.InteropServices; |
| 3 | + |
| 4 | +namespace PactNet.Interop |
| 5 | +{ |
| 6 | + /// <summary> |
| 7 | + /// Interop definitions to the Pact FFI library |
| 8 | + /// </summary> |
| 9 | + internal static class HttpInterop |
| 10 | + { |
| 11 | + private const string DllName = "pact_ffi"; |
| 12 | + |
| 13 | + [DllImport(DllName, EntryPoint = "pactffi_new_interaction")] |
| 14 | + public static extern InteractionHandle NewInteraction(PactHandle pact, string description); |
| 15 | + |
| 16 | + [DllImport(DllName, EntryPoint = "pactffi_with_request")] |
| 17 | + public static extern bool WithRequest(InteractionHandle interaction, string method, string path); |
| 18 | + |
| 19 | + [DllImport(DllName, EntryPoint = "pactffi_with_query_parameter_v2")] |
| 20 | + public static extern bool WithQueryParameter(InteractionHandle interaction, string name, UIntPtr index, string value); |
| 21 | + |
| 22 | + [DllImport(DllName, EntryPoint = "pactffi_with_header_v2")] |
| 23 | + public static extern bool WithHeader(InteractionHandle interaction, InteractionPart part, string name, UIntPtr index, string value); |
| 24 | + |
| 25 | + [DllImport(DllName, EntryPoint = "pactffi_response_status")] |
| 26 | + public static extern bool ResponseStatus(InteractionHandle interaction, ushort status); |
| 27 | + |
| 28 | + [DllImport(DllName, EntryPoint = "pactffi_with_body")] |
| 29 | + public static extern bool WithBody(InteractionHandle interaction, InteractionPart part, string contentType, string body); |
| 30 | + } |
| 31 | +} |
0 commit comments