Support HTTP headers option for APIs that require extra headers

Created on 29 August 2013, about 11 years ago
Updated 4 November 2024, 17 days ago

There are two USAJobs APIs available, one from USAJobs (https://data.usajobs.gov/Rest) and one from USASearch(http://usasearch.howto.gov/developer/jobs.html). The USASearch option only supports JSON format. The USAJobs one supports XML and JSON, but JSON is the default. The API requires the use of the Content-Type HTTP request header (Content-Type: application/xml ) in order to return XML instead of JSON.

Can an optional setting be added to the Views Query Settings to specify the Content-Type header which would then be supplied in the headers array to the drupal_http_request function?

I'll try to work on a patch for this functionality, but if someone with better PHP skills wants to jump in and add it more quickly, please do.

There doesn't appear to be a working alternative to this module for JSON parsing. This sandbox module (https://drupal.org/sandbox/clevername/1630546) never had any code checked into it. There is one issue in it's queue with someone linking to their equivalent module on Github, but I'm weary to use that.

Thanks!

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States timwood Rockville, Maryland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024