Android Question Communication with rest api by get function in ok httputils2 library

Amirfk

Member
Hello, I am using the following code to communicate with the rest api, but I am facing a 404 error.
Each link and variable are correct.
What suggestion and criticism do you have for this problem, thanks in advance .
 

walterf25

Expert
Licensed User
Longtime User
Hello, I am using the following code to communicate with the rest api, but I am facing a 404 error.
Each link and variable are correct.
What suggestion and criticism do you have for this problem, thanks in advance .
Where is the code?
 
Upvote 0

Amirfk

Member
rest api:
    ar_req.Initialize("ar_req",Me)
    ar_req.Download2("https://app.example.com/api/v1/user_formats", Array As String("id","29"))
    ar_req.GetRequest.SetHeader("Authorize","Bearer MY_TOCKEN_IS_CORRECT")
error :

ResponseError. Reason: , Response: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Not Found</title>
<style>
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a ...
 
Upvote 0

Amirfk

Member
Authorize header looks strange. Maybe it should be Authorization.
Thanks Earl.
The sample code is healthy, the problem was with the link.

rest api with get:
    ar_req.Initialize("ar_req",Me)
    ar_req.Download("https://app.example.com/api/v1/user_formats/29")
    ar_req.GetRequest.SetHeader("Authorize","Bearer MY_TOKEN")
 
Upvote 0
Top