Skip to content

Defining header on the request body content? #120

Answered by SchlenkR
konst-sh asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @konst-sh,

some month ago you wrote; here's my reply :)

  • there are well-known headers, which can be used in a safe way, instead of using strings as header keys.
  • ContentType is a heady related to the body, so it has to be defined in the body section of the request. Better: you use one of the available custom operations like json or jsonSerialize, which sets the content type automatically.
http {
    GET "url"

    Accept "application/vnd.onshape.v2+json;charset=UTF-8;qs=0.2"
    header "OnNonce" "nonce"
    AuthorizationBearer "token"
    Date DateTime.Now

    body
    ContentType "application/json"
}
|> Request.send

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@konst-sh
Comment options

Answer selected by konst-sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants