Skip to main content
Question

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

  • November 3, 2022
  • 5 replies
  • 176 views

Forum|alt.badge.img

$ 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

geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • November 4, 2022

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

The SystemCaller may be of help here.


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • November 4, 2022

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()

 


Forum|alt.badge.img
  • Author
  • November 4, 2022
f.kemminje wrote:

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


nampreetatsafe
Safer
Forum|alt.badge.img+13

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


Forum|alt.badge.img
  • Author
  • November 7, 2022
nampreetatsafe wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings