Solved

Routing Address - post request to http

  • 19 May 2020
  • 5 replies
  • 127 views

Userlevel 2
Badge +5

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.

 

icon

Best answer by dsj 19 May 2020, 12:39

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

5 replies

Userlevel 6
Badge +11

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

Userlevel 2
Badge +5

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

Userlevel 6
Badge +11

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

Userlevel 2
Badge +5

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

Thanks

Userlevel 2
Badge +5

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