Skip to main content
Answer

Routing Address - post request to http

  • May 19, 2020
  • 5 replies
  • 876 views

krestensb
Sidekick (Customer)
Forum|alt.badge.img+8

Hi,

I’m on IFS 9 and I would like to send a post request to a routing address.

IFS 9 doesn’t support destination type REST, so I need to use HTTP.

I know the endpoint, and from postman I have copied this HTTP request:

 

When I try to call this endpoint from IFS using a routing address I get “Internal server error” back.

I know the headers and the message are correct, but IFS doesn’t seam to read them correct.

How could this be done?

Any help is very much appreciated.

 

Best answer by dsj

Seems your application accepts only Content-Type: Application/json

Usually, a HTTP request has only one Content-Type header parameter and it depends your application how it’s used. What I think is your application accepts only the first header field.

I just tried your api with text/plain content type header in postman and got the same response getting from IFS.

 

/Damith

5 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • May 19, 2020

Hi,

I’m on IFS 9 and I would like to send a post request to a routing address.

IFS 9 doesn’t support destination type REST, so I need to use HTTP.

I know the endpoint, and from postman I have copied this HTTP request:

 

When I try to call this endpoint from IFS using a routing address I get “Internal server error” back.

I know the headers and the message are correct, but IFS doesn’t seam to read them correct.

How could this be done?

Any help is very much appreciated.

 

 

Hi @krestensb,

Can you change your application to accept requests with Content-Type: text/plain header?

Seems IFS HTTP sender tags request with Content-Type: text/plain header by default.

 

/Damith


krestensb
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • May 19, 2020

I can try.
Does it mean it will only accept Content-Type: text/plain ?

 

What headers I’m sending from postman is:

Content-Type: text/plain

Content-Type: Application/json


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Answer
  • May 19, 2020

Seems your application accepts only Content-Type: Application/json

Usually, a HTTP request has only one Content-Type header parameter and it depends your application how it’s used. What I think is your application accepts only the first header field.

I just tried your api with text/plain content type header in postman and got the same response getting from IFS.

 

/Damith


krestensb
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • May 20, 2020

I changed the api, to accept text/plain, and now it works.

Thanks


krestensb
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • May 20, 2020

Next step in this for me is to grap the response from the endpoint and work with it in the database.

Follow along in this new question:

https://community.ifs.com/technology-all-about-the-nuts-and-bolts-that-make-it-work-50/how-to-grap-the-application-message-response-1880