Question

HTTP Caller - HTTP/1.1 415 Unsupported Media Type

  • 23 August 2019
  • 6 replies
  • 25 views

Badge

I'm getting an error with the HTTP Caller in my workbench. I'm calling a POST request on my dev website and keep getting the following error;

"HTTPCaller (HTTPFactory): Received HTTP response header: 'HTTP/1.1 415 Unsupported Media Type' from 'https://xxxxxxx.com/dev/xxxxxxxxx/xxxxxxx?sample_id=J55-1-29&apitoken=xxxxxxxxx&sample_depth_base=1391.1&surface_latitude=50.68319&surface_longitude=-101.860471&location_name=test1&toc=99&lithostrat_group=NULL&formation=Winnipeg&member=NULL&sample_lithology=Shale%2Fmudstone&gts_period_old=Ordovician&s_c_ratio=NULL&o_c_ratio=NULL&h_c_ratio=NULL&inertinite=NULL&liptinite=NULL&vitrinite=NULL&s2=96.19&tmax=435&hydrogen_index=924&oxygen_index=16&production_index=0.01&vroe=0.8&ro=NULL&thermal_alteration_index=NULL&spore_colour_index=NULL'

 

The string it is trying to pass through works successfully when pasted into a browser or when making a POST request through Postman. I presume it is therefore a problem with a setting in my workbench. Screengrab of the HTTP caller settings below. Any help much appreciated.

 


6 replies

Userlevel 4

What happens if you set the response body encoding to Unicode UTF-8? Does that make a difference?

Also, try to send the Rejected port to the Inspector and look for hints in the response headers.

Userlevel 6
Badge +32

There are some special characters which seem to be off. Are you sure if you paste the FME generated url in you browser it works?

https://xxxxxxx.com/dev/xxxxxxxxx/xxxxxxx?sample_id=J55-1-29≈itoken=xxxxxxxxx&
sample_depth_base=1391.1&
surface_latitude=50.68319&
surface_longitude=-101.860471&
location_name=test1&
toc=99&
lithostrat_group=NULL&
formation=Winnipeg&
member=NULL&
sample_lithology=Shale%2Fmudstone>s_period_old=Ordovician&
s_c_ratio=NULL&
o_c_ratio=NULL&
h_c_ratio=NULL∈ertinite=NULL&
liptinite=NULL&
vitrinite=NULL&
s2=96.19&
tmax=435&
hydrogen_index=924&
oxygen_index=16∏uction_index=0.01&
vroe=0.8&
ro=NULL&
thermal_alteration_index=NULL&
spore_colour_index=NULL
  • line 1 has ≈
  • line 13 has ∈
  • line 19 has ∏
Badge

Thanks for the responses.

@nielsgerrits, you're right, the url I pasted had some errors - no idea what happened there. The url generated from FME doesn't have these errors and does work when pasted into a browser or into Postman.

@david_r, Unicode UTF-8 doesn't make a difference unfortunately. Using an inspector connected to the 'rejected' port doesn't provide any additional information either.

Userlevel 4

I'm just now noticing from the screenshot that you've specified a POST request but without specifying any upload body. Is that correct?

Remember that pasting the URL into a browser will result in a GET request, not POST.

I also notice that there are no headers specified. Is that correct, or does the server require that e.g. the upload body media type to be specified? That could well be the issue here.

Badge

I'm just now noticing from the screenshot that you've specified a POST request but without specifying any upload body. Is that correct?

Remember that pasting the URL into a browser will result in a GET request, not POST.

I also notice that there are no headers specified. Is that correct, or does the server require that e.g. the upload body media type to be specified? That could well be the issue here.

Good point about it being a GET request when posted into a browser - that hadn't occurred to me (I'm a bit new to this). However, when the 'failed' string from the POST is pasted into the test function of the POST method in AWS API gateway, it runs successfully and does update the record in our SQL database as desired.

With regards to upload body and headers, I have left both of these settings as they were in my PUT workbench, as this workbench with these settings has successfully called the API's PUT method and written data to the SQL database. If PUT and POST requests are likely to require different settings then that might be the issue, as you say. Screengrabs of both below in case it helps at all.

 

Userlevel 4

Good point about it being a GET request when posted into a browser - that hadn't occurred to me (I'm a bit new to this). However, when the 'failed' string from the POST is pasted into the test function of the POST method in AWS API gateway, it runs successfully and does update the record in our SQL database as desired.

With regards to upload body and headers, I have left both of these settings as they were in my PUT workbench, as this workbench with these settings has successfully called the API's PUT method and written data to the SQL database. If PUT and POST requests are likely to require different settings then that might be the issue, as you say. Screengrabs of both below in case it helps at all.

 

In the end, the error message you get is coming from the server side, not from FME. So my priority would be to look into the API docs to see what the server expects for that particular request.

Reply