Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
Two days ago my customer contacted me about this message when he tries Add new Biblio Content using DOI import:
"HTTP error: 400 when trying to contact crossref.org for XML input"
He was using version 7.x-1.0-rc5 . I updated to 7.x-1.0-rc7 and the problem continues. Does anybody knows the why of this message ?
Comments
Comment #1
kevinsullivan CreditAttribution: kevinsullivan commentedI debugged the problem.
In the Biblio file, ...site/all/modules/biblio/modules/crossref/biblio.crossref.client.php, in the function called fetch, you have to make the following change:
FROM: $request_options = array('method' => 'POST');
TO: $request_options = array('method' => 'GET');
It should have been GET in the first place, I suppose; but it seems that POST had been working, as well.
The problem is that the crossref.org server is now throwing a Java exception when you present it with a POST request at this URL, thus producing the 400 server error.
Kevin Sullivan
Comment #2
wescleyteixeira CreditAttribution: wescleyteixeira commentedHi kevinsullivan,
It worked, now the website is working fine!
Thanks for explain about the changes in crossref.org too.
Best Regard!!
Comment #3
rjerome CreditAttribution: rjerome commentedI've committed that change. Thanks Kevin for tracking it down.
Comment #4
rjerome CreditAttribution: rjerome commentedComment #6
schillij CreditAttribution: schillij commentedI made the change suggested by kevinsullivan in #1 and still get the same error message.
"HTTP error: 400 when trying to contact crossref.org for XML input"
Any other suggestions to correct this issue?
Jeff
Comment #7
Jujubre CreditAttribution: Jujubre commentedI got the same issue, #1 solved it.
The queried url can be retrieved for testing in you browser by adding a line in fetch():
Comment #8
gchalker@princeton.edu CreditAttribution: gchalker@princeton.edu commentedKudos to KevinSullivan! Worked like a charm.
Comment #9
Alan D. CreditAttribution: Alan D. commentedSlightly clearer fix, for a cleaner easier read code base. Albeit I am not reopening for this simple style fix.
From
To
Reference: http://cgit.drupalcode.org/biblio/commit/?id=fd8ee42
Comment #10
Mark F CreditAttribution: Mark F as a volunteer commentedStill getting this issue on rc7 and -dev (todays date - tried both). Made all of the changes above in both. Still got same error. Using ' 10.1056/NEJMoa1402454' as the DOI.
Comment #11
bib_boy CreditAttribution: bib_boy commented#1 worked for me...POST -> GET
thanks!