Skip to main content
Solved

Routing Address - post request to http


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

View original
Did this topic help you find an answer to your question?

5 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 861 replies
  • May 19, 2020
krestensb wrote:

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)
  • 40 replies
  • 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)
  • 861 replies
  • 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)
  • 40 replies
  • 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)
  • 40 replies
  • 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


Reply


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