Skip to content

Commit 358aea7

Browse files
authored
Update README.md
1 parent 493475a commit 358aea7

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,40 @@ If you're waiting for me or have any questions for me, bug me!
2626
param1=A&param2=B
2727

2828
- headers (string, in XML format) - This allows you to set headers for the HTTP request. They are passed as XML following this format:
29-
30-
<Headers>
31-
<Header Name="MyHeader">My Header's Value</Header>
32-
<Header Name="…"></Header>
33-
<Header Name="…"></Header>
34-
</Headers>
29+
```
30+
<Headers>
31+
<Header Name="MyHeader">My Header's Value</Header>
32+
<Header Name="…">…</Header>
33+
<Header Name="…">…</Header>
34+
</Headers>
35+
```
3536

3637
- options (string, in XML format) - This allows you to specify several options to fine-tune the HTTP Request. They are passed as XML following this format:
3738

38-
&lt;Options&gt;
39-
&lt;*option_name*&gt;*option value*&lt;/*option_name*&gt;
40-
&lt;/Options&gt;
39+
<Options>
40+
<*option_name*>*option value*</*option_name*>
41+
</Options>
4142

4243
Available options:
4344
- security_protocol
4445

4546
Pass a CSV of protocols from the [SecurityProtocolType Enum](https://docs.microsoft.com/en-us/dotnet/api/system.net.securityprotocoltype)
4647

47-
Example: '&lt;security_protocol&gt;Tls12,Tls11,Tls&lt;/security_protocol&gt;'
48+
Example: '<security_protocol>Tls12,Tls11,Tls</security_protocol>'
4849

4950
- timeout
5051
Sets the [HttpWebRequest.Timeout Property](https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.timeout) as the number of milliseconds until the request times out
51-
Example: '&lt;timeout&gt;60000&lt;/timeout&gt;' is 60,000 milliseconds, which is 60 seconds (1 minute).
52+
Example: '<timeout>60000</timeout>' is 60,000 milliseconds, which is 60 seconds (1 minute).
5253
- auto_decompress
5354
Sets the [HttpWebRequest.AutomaticDecompression Property](https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.automaticdecompression) to automatically decompress the response
54-
Example: '&lt;auto_decompress&gt;true&lt;/auto_decompress&gt;'
55+
Example: '<auto_decompress>true</auto_decompress>'
5556
- convert_response_to_base64
5657
Base64 encodes response. This is particularly useful if the response is a file rather than just text.
57-
Example: '&lt;convert_response_to_base64&gt;true&lt;/convert_response_to_base64&gt;
58+
Example: '<convert_response_to_base64>true</convert_response_to_base64>
5859
Note, in SQL Server you're able to then decode using something like 'CAST(@string AS XML).value(\'.\', \'VARBINARY(MAX)\')'
5960
- debug
6061
Includes an element in the Response XML with info for each step of the execution
61-
Example: '&lt;debug&gt;true&lt;/debug&gt;
62+
Example: '<debug>true</debug>
6263

6364
### Returned XML
6465

@@ -165,7 +166,7 @@ RETURNS XML AS EXTERNAL NAME [ClrHttpRequest].[UserDefinedFunctions].[clr_http_r
165166

166167
### A quick test to confirm it works
167168
```
168-
SELECT [dbo].[clr_http_request]('GET', 'https://github.com/eilerth/sqlclr-http-request/', NULL, NULL, '&lt;Options&gt;&lt;security_protocol&gt;Tls12&lt;/security_protocol&gt;&lt;/Options&gt;');
169+
SELECT [dbo].[clr_http_request]('GET', 'https://github.com/eilerth/sqlclr-http-request/', NULL, NULL, '<Options><security_protocol>Tls12</security_protocol></Options>');
169170
```
170171

171172
## Should this be a feature shipped with SQL Server?

0 commit comments

Comments
 (0)