Error 403 403.4 in uploading to Google Docs using Zend - api

I tried using google docs sample in the Zend Gdata demos and got the following error :
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with
message 'Expected response code 200, got 403 403.4 SSL required' in
F:\PHP_libs\Zend\Gdata\App.php:714 Stack trace: #0
F:\PHP_libs\Zend\Gdata.php(219):
Zend_Gdata_App->performHttpRequest('GET', 'http://docs.goo...', Array,
NULL, NULL, NULL) #1 F:\PHP_libs\Zend\Gdata\App.php(880):
Zend_Gdata->performHttpRequest('GET', 'http://docs.goo...', Array) #2
F:\PHP_libs\Zend\Gdata\App.php(768):
Zend_Gdata_App->get('http://docs.goo...', NULL) #3
F:\PHP_libs\Zend\Gdata\App.php(210):
Zend_Gdata_App->importUrl('http://docs.goo...', 'Zend_Gdata_Docs...',
NULL) #4 F:\PHP_libs\Zend\Gdata.php(162):
Zend_Gdata_App->getFeed('http://docs.goo...', 'Zend_Gdata_Docs...') #5
F:\PHP_libs\Zend\Gdata\Docs.php(130):
Zend_Gdata->getFeed('http://docs.goo...', 'Zend_Gdata_Docs...') #6
F:\xampp\htdocs\ZendGdata-1.11.12\demos\Zend\Gdata\Docs.php(277):
Zend_Gdata_Docs->getDocumentListFeed('http://docs.goo...') #7
F:\xampp\htdocs\ZendGdata-1.11.12\demos\Zend\Gdata\Docs.php(752):
retrieveWPD in F:\PHP_libs\Zend\Gdata\App.php on line 714
I am using Zend library for the first time and am unable to figure out how Authorization works here. Please help

I'm not sure if this is fixed in the latest version of the Zend library but I went and updated this file in my Zend install:
library/Zend/Gdata/Docs.php
The constants around line 62 needed to be updated to change the http to https which now look like this in my install:
const DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full';
const DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full';
const DOCUMENTS_CATEGORY_SCHEMA = 'https://schemas.google.com/g/2005#kind';
const DOCUMENTS_CATEGORY_TERM = 'https://schemas.google.com/docs/2007#folder';
That did the trick.

You must use https instead of http if you want to connect to GoogleDocs, which is stated in the error message you are getting: Expected response code 200, got 403 403.4 SSL required. The parts of the message are interpreted like this:
Expected response code 200: the called method expect the http response code to be 200
got 403: the actual received http code
403.4 SSL required: a short description to the code
Look at List of HTTP status codes to get more information.
The examples from the Zend Framework: Documentation: Using Google Documents List Data API - Zend Framework Manual aren't up-to-date and should be like this:
$feed = $docs->getDocumentListFeed(
'https://docs.google.com/feeds/documents/private/full/-/document');

Related

Express JS changing line break type to CRLF

I am trying to make a HTTP request from a Flutter App to a Express-JS Server running on an Ubuntu machine. A newer version of Flutter(v1.22.5) throws following error when making the Request:
E/flutter (29477): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Invalid response, unexpected 10 in reason phrase
The code for making the request looks like this:
final response = await http.get(
'http://XX.XX.XXX.XXX/employees', //Hiding IP address for privacy purposes
headers: {
"Content-Type": "application/json",
"Authorization": api_key,
},
);
print(response.statusCode);
I can confirm by using HTTP-Tester Insomnia that the queried URL does indeed return information.
The issue seems to be known and can be viewed here
According to the Github-Thread, the issue is due to wrong line break format in the headers.
How can I tell Express JS to use CRLF?
For anyone stumbling across this question, I fixed it by reconfiguring my API-Server. Closer inspection of this problem lead to the conclusion that neither the App nor the API was bad, due to the fact no API-Request did actually reach my API-Code. I figured it out by simply looking at the logs. In my case, it was NginX not working properly as a reverse-proxy. I followed this tutorial to properly set it put.

Response code:400 Response message:Bad Request Jmeter api testing with JIRA with POST method

When try to create issue in Jira using the JMeter API with POST method, it does not allow to create issue and it shows error below.
I uploaded my all configuration image.
Can anybody correct me?
Thanks in advance.
Error message:
2020-12-27 19:48:35,841 ERROR o.a.j.p.h.s.HTTPJavaImpl: readResponse: java.io.IOException: Server
returned HTTP response code: 400 for URL: https://learntestapi.atlassian.net/rest/api/2/issue
2020-12-27 19:48:35,841 ERROR o.a.j.p.h.s.HTTPJavaImpl: Cause: java.io.IOException: Server returned
HTTP response code: 400 for URL: https://learntestapi.atlassian.net/rest/api/2/issue
Screenshots (2 images attached)
I think you're using an incorrect URL, i.e. it has to be:
/rest/api/2/issue/createmeta/QA/issuetypes/{issueTypeId}
to identify the issueTypeId you need to first execute call to the following endpoint:
/rest/api/2/issue/createmeta/QA/issuetypes
then choose an appropriate issue type and substitute it in the first request.
More information: Jira REST API examples
Also make sure that your HTTP Header Manager is configured to send Content-Type header with the value of application/json

Recieving 404 error when running get request to Amadeus low-fare-search API

Hi I am very new to Angular and programming in general and I have been trying to query the Amadeus low-fare-search with Angular HTTPClient and failing, I have been looking around for answers, but havent found anything specific to this, I have found some answers related to the specific problem of "unable to identify proxy".
And according to some the reason for this is that the URL is incorrect.
But this is the URL on Amadeus page
Resource URL
This is the code i am trying to run :
search(){
return this.http.get('http://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey=my API key')
.subscribe((data) =>{
console.log(data)},
(err) => {console.log(err)});
Here is the error message
errorcode: "messaging.adaptors.http.flow.ApplicationNotFound"
faultstring:"Unable to identify proxy for host: default and url:
/v1.2/flights/low-fare-search"
Can someone explain to me in simple terms what could be causing this error?
In your example, you are using http instead of https
I tested your example and it works for me:
https://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=IST&destination=BOS&departure_date=2018-10-15&return_date=2018-10-21&number_of_results=3&apikey={your_api_key}

Customize Error Pages for HTTP error codes?

How can I have custom error pages for HTTP errors like 401, 403, 404, ... in HANA (version 1.00.122.08)?
In case this question refers to the XSC (classic) version of the web application server, the answer is: there is no option to customize the error messages.
On option to deal with this is to handle all requests through an inverse proxy/load balancer and use its custom error messages.

Dropbox php sdk library errors

I am trying to set dropbox api up on this website http://wedapp.users34.interdns.co.uk/
I am using this library http://code.google.com/p/dropbox-php/
I am getting lots of issues i have contacted my host and they have confirmed that i have The OAuth extension installed.
Just keep getting lots of errors like below.
Fatal error: Uncaught exception 'OAuthException' with message 'Invalid
auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)' in
/home/wedapp/public_html/Dropbox/OAuth/PHP.php:73 Stack trace: #0
/home/wedapp/public_html/Dropbox/OAuth/PHP.php(73):
OAuth->fetch('https://api.dro...', Array, 'POST', Array) #1
/home/wedapp/public_html/Dropbox/API.php(97):
Dropbox_OAuth_PHP->fetch('https://api.dro...', Array, 'POST') #2
/home/wedapp/public_html/index.php(13):
Dropbox_API->getToken('info#isimpledes...', 'webdesigner1982') #3
{main} thrown in /home/wedapp/public_html/Dropbox/OAuth/PHP.php on
line 73
you can see the errors i am getting here. http://wedapp.users34.interdns.co.uk/
Any thing please guys.
A 401 error means "Bad or expired token. This can happen if the user or Dropbox revoked or expired an access token. To fix, you should re-authenticate the user." ( https://www.dropbox.com/developers/reference/api )
You will need to go through the app authentication process again to get a valid token.