Requesting help with an external API request - "Actor input must have content type "application/json
Hi, I would really appreciate some help resolving my problem here. I am trying to make an external API request to an Apify actor with a POST request method to run actor synchronously and get dataset items. The debugger is saying "Actor input must have content type "application/json".", but I see "content-type: application/json" is already written in the header. How do I resolve this?
response:
{headers: [HTTP/2 400,date: Fri, 03 Nov 2023 18:26:24 GMT,content-type: application/json; charset=utf-8,content-length: 123,cache-control: no-cache, no-store, must-revalidate,pragma: no-cache,expires: 0,access-control-allow-origin: *,access-control-allow-headers: User-Agent, Content-Type, Authorization, X-Apify-Request-Origin, openai-conversation-id, openai-ephemeral-user-id,access-control-allow-methods: GET, POST,access-control-expose-headers: X-Apify-Pagination-Total, X-Apify-Pagination-Offset, X-Apify-Pagination-Desc, X-Apify-Pagination-Count, X-Apify-Pagination-Limit,referrer-policy: no-referrer,x-robots-tag: none,x-ratelimit-limit: 200,etag: W/"7b-2QUGcaO1hCNQE8SGd2vv9gi+ii4",vary: Accept-Encoding],
result: {error: {type: invalid-input,message: Actor input must have content type "application/json".}},
status: 400
The input/result states after running: "Whoops! An error occurred.Exception: Please use a numerically indexed array."
Thanks!
Answers
-
Hi, @lijern. What you're showing here is the response (what the API is sending back), but we'll want to review the request to make sure the content type is specified. To specify the header, in the 'headers' section of your external API request, you can add a Push filter, and specify the value of "Content-Type: application/json". Let me know if this helps or if you have any other questions!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback