Programming

Programming questions? Ask a programmer for answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Need help on golang. Go. I am trying to extract data from an…

Customer Question
Need help on golang ...

Need help on golang

Technician's Assistant: Is there a specific language you're coding in?

Go

Technician's Assistant: What's your objective? How can we solve this for you?

I am trying to extract data from an API, I am able to do it when I run curl, but when I try programattically it does not give any data

Submitted: 7 months ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Answered in 2 hours by:
1/3/2018
Programmer: RussellA, Computer Science Teacher replied 7 months ago
RussellA
RussellA, Computer Science Teacher
Category: Programming
Satisfied Customers: 275
Experience: PHP, SQL, JAVA, SHELL
Verified

Can you post your CURL statement here please

Ask Your Own Programming Question
Programmer: RussellA, Computer Science Teacher replied 7 months ago

If you can provide a little more details I can be specific with the answer, but generically speaking

Using telnet to check:

$ telnet erdos.sdslabs.co 80 Trying 62.141.37.215... Connected to erdos.sdslabs.co. Escape character is '^]'. GET http://erdos.sdslabs.co/users/shagun.json HTTP/1.0 HTTP/1.1 302 Found Date: Sat, 26 Jul 2014 11:18:58 GMT Server: Apache Set-Cookie: PHPSESSID=juvg7vrg3vs4t00om3a95m4sc7; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: /login Access-Control-Allow-Origin: http://erdos.sdslabs.co X-Powered-By: PleskLin Content-Length: 1449 Connection: close Content-Type: application/json {"email":"*****@******.***","username":"shagun","name":"Shagun [...]

We see that the web server is responding with a 302 - a redirection to Location /login. Requests and web browsers are obeying that, and reaching the login prompt. However, we see that the web server is also responding with the json you're after, and curl (and telnet) are simple enough to just accept that data.

Best practice would be to fix the web server so that it either doesn't require you to log in, or doesn't give out password-protected data at the same time as asking users to log in.

If you can't change the web server, you could tell the requests module to ignore redirects:

import requests result = requests.get('http://erdos.sdslabs.co/users/shagun.json', allow_redirects=False) print result.content

Ask Your Own Programming Question
Programmer: RussellA, Computer Science Teacher replied 7 months ago

I hope these steps help you in rectifying your issue. If you are satisfied please mark this as answered so I can get compensated for my time, or if you have any further questions, please don't hesitate to open another query directly with me.

Ask Your Own Programming Question
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a programmerLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask RussellA Your Own Question
RussellA
RussellA
RussellA, Computer Science Teacher
Category: Programming
Satisfied Customers: 275
275 Satisfied Customers
Experience: PHP, SQL, JAVA, SHELL

RussellA is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,175 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

848 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
I have a specific question about a REST API request I am
I have a specific question about a REST API request I am trying to make with an IBM webservice that I can successfully make within API testing tools, but am getting an "not authorized" error within my… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
Need help with googles API/Javascript. I am using a map with
Need help with googles API/Javascript. I am using a map with an autocomplete input and have it working. I am trying to use another script to autocomplete a small form with the data from the autocomple… read more
Steve
Steve
Consultant
Bachelor
69 satisfied customers
I am trying to merge a couple of macros together on a
I am trying to merge a couple of macros together on a project and I am getting an error that says the macro may not be available in this workbook or all macros may be disabled. The VBA is setup as 4 p… read more
Bryan
Bryan
735 satisfied customers
How do you tell if data has arrived on an open socket? • how
how do you tell if data has arrived on an open socket? • how do you do non-blocking I/O on a socket? • describe any higher-level mechanism for remote-method invocation • (java RMI, CORBA, publish/subs… read more
Michael Hannigan
Michael Hannigan
Bachelor\u0027s Program
239 satisfied customers
I don´t have any option on paypal to pay $5 to start.I guess
I don´t have any option on paypal to pay $5 to start. I guess by accepting to pay now $44, the payment is finished and the money are yours, no matter of my satisfaction level.… read more
toughguy
toughguy
Master\u0027s Degree
210 satisfied customers
I have been using Zend Framework to connect to Google
I have been using Zend Framework to connect to Google calendar with PHP from my website. Because of the deprecation of v 2 from Google it no longer works. I was thinking about some work around and als… read more
Michael Hannigan
Michael Hannigan
Bachelor\u0027s Program
239 satisfied customers
I am trying to display external search box data (https://support.servicenow.com/support/su
I am trying to display external search box data (https://support.servicenow.com/support/support.do) result to my webpage using Ajax. I tried $(document).ready(function(){ $.getJSON("https://support.se… read more
Monty
Monty
Senior Applications Developer
High School or GED
31 satisfied customers
Hi Brandon, I am working with Yanyan Liu and we need some
Hi Brandon, I am working with Yanyan Liu and we need some data extracted from a pdf file and reformatted into an excel file for analysis. Can you help us with this? Megan… read more
Brandon M.
Brandon M.
System Administrator
Vocational, Technical or Trade Scho
2,143 satisfied customers
I have a Vb6 app that set an object to call a function from
I have a Vb6 app that set an object to call a function from a .net dll. this function call an API. Once my app closes I lose that object. is there anyway I an keep this object open when my vb6 app clo… read more
Steven Caliendo
Steven Caliendo
Vocational, Technical or Trade Scho
99 satisfied customers
Im reading some basics on API calls and Im just wondering
I'm reading some basics on API calls and I'm just wondering what program do I need to start making API calls?… read more
AAATom
AAATom
Software Engineer
Master\u0027s Degree
42 satisfied customers
This week, you need to write a program for Magic Blender company,
This week, you need to write a program for Magic Blender company, which sells a blender for $39.95. The program should prompt the user for the following information: Name Street address City State Zip… read more
ATLPROG
ATLPROG
Computer Software Engineer
Master's Degree
7,677 satisfied customers
Im using cURL to grab information from the Etsy API, and I
I'm using cURL to grab information from the Etsy API, and I need to process it into something useful, but I'm not quite sure how. Here's an example of the data (I believe it's in JSON format): {"count… read more
Arty
Arty
Senior Administrator
Bachelor\u0027s Degree
469 satisfied customers
I have web software that is written in PHP and CMS. At this
I have web software that is written in PHP and CMS. At this point my customers must manually enter the data (product description) and manually upload images of their products. For example, an automobi… read more
Eljon
Eljon
Software Developer Consultant
Associate Degree
562 satisfied customers
I want to send a request to a remote web server that has a
I want to send a request to a remote web server that has a PHP page from a linux command line. For instance, the location of the file is https://www.mywebserver.com/script.php. I also have to pass var… read more
Eljon
Eljon
Software Developer Consultant
Associate Degree
562 satisfied customers
how do i modify the code below so that when its run the output
how do i modify the code below so that when its run the output will look like the output below? Month Balance Interest Acc. Interest 1 1002.50 2.50 2.50 2 1005.01 2.51 5.01 package savings; import jav… read more
Raj
Raj
SAP ABAP Consultant
Master\u0027s Degree
27 satisfied customers
hi need help its reagarding extracting data from a iframe please
hi need help its reagarding extracting data from a iframe please answer the question only if you now what you are talking about and how to do this no google copy and pasting. i am trying to extract da… read more
Marius
Marius
Bachelor's Degree
2 satisfied customers
When i try to run an Access DB Form gives me the error User-defined
When i try to run an Access DB Form gives me the error "User-defined type not defined" There is VB Module CODE which has worked before but does not work now. I am running the ACCESS DB that has Access… read more
Dharmendra
Dharmendra
Master\u0027s Degree
275 satisfied customers
Greetings. Im in a bind so Im hoping you can help. Short
Greetings. I'm in a bind so I'm hoping you can help. Short overview. I've developed an application for a client, but to get to it I have to handshake through their SSO protocol, which sends xml data b… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x