'How to use body for GET method in ADF's web activity with x-www-form-urlencoded content?

I am working on a task, where i need to call an api use GET method and have to pass some data into body. I am mainly using Azure data factory Web activity for same but I am not able to see any section when i can put the data in body.

enter image description here

As you can see, the content type is x-www-form-urlencoded so i have to pass grant_type inside body in order to get the required output. Can someone help me if they were able to pass body while GET method in ADF?

Many thanks



Solution 1:[1]

In Azure Data Factory there is no option body in the GET method, so you can use the POST method to pass some data into the body.

I reproduced and created a sample example you can follow this:

Ref1 Ref2 Ref3

Reference:

https://www.youtube.com/watch?v=wbURJiKoBlg&t=213s

https://docs.microsoft.com/en-us/rest/api/datafactory/pipelines/get

Solution 2:[2]

In Python 3.4+ you can get the names using dis.get_instructions. To support nested functions as well you need to recursively loop over each code object you encounter:

import dis
import types

def get_names(f):
    ins = dis.get_instructions(f)
    for x in ins:
        try:
            if x.opcode == 100 and '<locals>' in next(ins).argval\
                                              and next(ins).opcode == 132:
                yield next(ins).argrepr
                yield from get_names(x.argval)
        except Exception:
            pass

Demo:

def func():
    x = 1
    y = 2
    print ('foo')
    class A:
        def method(self):
            pass
    def f1():
        z = 3
        print ('bar')
        def f2():
            a = 4
            def f3():
                b = [1, 2, 3]
    def f4():
        pass

print(list(get_names(func)))

Outputs:

['f1', 'f2', 'f3', 'f4']

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2