In PostMan I'm able to pass a json in the body to a HTTP:GET.

How can this be resolved in SQL Anywhere

I have created this function.

create function PM_GetConnectionShippingLineTariff(in in_Json long varchar,in baseurl long varchar)
returns long varchar
URL '!baseurl/api/fetch-connection-shipping-line-tariff'
TYPE 'HTTP:GET'
SET 'HTTP(VERSION=1.1)'
HEADER 'Accept: application/json'

What do I need to change to pass the in_Json in the body of the request?

asked 05 Jul '19, 07:15

Frank%20Vestjens's gravatar image

Frank Vestjens
1.2k324358
accept rate: 20%

edited 05 Jul '19, 07:15


A GET request does not contain a body according to the HTTP specification. If you want to send a document in the body then you need to use a POST request. To do this, you could just change your definition to be TYPE 'HTTP:POST', but you may also want to change the function's name to be PM_Post...

HTH

permanent link

answered 05 Jul '19, 09:08

Mark%20Culp's gravatar image

Mark Culp
24.8k9139296
accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×31

question asked: 05 Jul '19, 07:15

question was seen: 1,010 times

last updated: 05 Jul '19, 09:08