Question

Hello, Can somebody help me to call the following curl command through HTTPCaller via FME Desktop?

  • 3 November 2022
  • 5 replies
  • 38 views

Badge

$ curl -X POST --noproxy “*” -k "https://server_name/connect/token" -H "Content-Type: application/x-www-form-urlencoded" -d "username=asdfg" -d "password=ghjkl" -d "client_id=CLIENT_ID" -d "client_secret=CLIENT_SECRET" -d "scopes=openid profile role" -d "grant_type=password"  


5 replies

Userlevel 4
Badge +36

Curl is meant to be run from the command line, not through HTTPCaller.

The SystemCaller may be of help here.

Badge +3

you can use python caller also to do this

 

import urllib2

data = '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP", "actions": "ALLOW", "priority": "10"}'

url = 'http://localhost:8080/firewall/rules/0000000000000001'

req = urllib2.Request(url, data, {'Content-Type': 'application/json'})

f = urllib2.urlopen(req)

for x in f:

print(x)

f.close()

 

Badge

you can use python caller also to do this

 

import urllib2

data = '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP", "actions": "ALLOW", "priority": "10"}'

url = 'http://localhost:8080/firewall/rules/0000000000000001'

req = urllib2.Request(url, data, {'Content-Type': 'application/json'})

f = urllib2.urlopen(req)

for x in f:

print(x)

f.close()

 

Thank you. I will try this

Userlevel 1
Badge +10

Hi @sal​, check out this article which runs through how you might use the HTTPCaller to make a call using cURL: https://community.safe.com/s/article/Web-Services-cURL-and-the-HTTPCaller

Badge

Hi @sal​, check out this article which runs through how you might use the HTTPCaller to make a call using cURL: https://community.safe.com/s/article/Web-Services-cURL-and-the-HTTPCaller

Thank you. It is really helpful.

Reply