microsoft / microsoft/sql-server-samples

Calling Http endpoints in T-SQL using CURL extension - Content Type.

Open
#1,197 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

In regards to : https://github.com/microsoft/sql-server-samples](https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/sql-clr/Curl)

What is the Content Type of the CURL.XPOST procedure, I need it to be application/json.

I am unable to locate where it mentions what the Content Type is in the source code.

See below for reference:

Curl Syntax:

curl \
  -X POST \
  -H "Content-Type: application/json" \
  -H "simcontrol-api-key: YOUR_API_KEY" \
  --data '{ "query": "{ account { name balance } }" }' \
  https://app.simcontrol.co.za/graphql/

My CURL.XPOST procedure:

declare @hkey nvarchar(200) = N'Content-Type: application/json/simcontrol-api-key: My-Key';
declare @body nvarchar(4000) = N'{ "query": "{ account { name balance } }" }'
declare @endpoint nvarchar(1000) = N'https://app.simcontrol.co.za/graphql/';

exec curl.XPOST @H = @hkey, @d = @body, @url = @endpoint
```;

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked samples/features/sql-clr/Curl source and locate the CURL.XPOST procedure. Compare its header argument with the provided curl syntax and determine how the Content-Type and API-key headers are represented. Done means the procedure's content type and header format are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
api, databases
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.