• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Simple Web Service transfer

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm really new to Web Services, and I have a little question for you champions !

So, I have an URL to get informations in JSON, this URL is something like : http://10.200.200.10/webservice/date/28-02-2017/
When I make a cURL in PHP on this URL, I get the JSON formatted message, so that works.

But for now, I have another constraint :

I should have a script between the first PHP script and the final URL. So, I'll have to call something like http://20.500.500.20/get-ws/, which has to get http://10.200.200.10/webservice/date/28-02-2017/.

How could I get, on my first PHP script, the result of the final API if there is another script between ?

I tried to do a cURL with the first PHP that calls the second script which makes itself another cURL, but it doesn't work !
How should I do ?

Thanks for your answers
 
Saloon Keeper
Posts: 6361
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"It doesn't work" is not a particularly useful problem description. What, exactly, is happening? Does curl work in general on that other server, outside of a PHP script?
 
Gaultier Trevor
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:"It doesn't work" is not a particularly useful problem description. What, exactly, is happening? Does curl work in general on that other server, outside of a PHP script?



Hi thank you for your answer.

In facts, when I try to make a var_dump() on the return of the first PHP cURL (the one that call another cURL), it's NULL.
Yes I tested the cURL and it works on that server !

Maybe my question should be different :

How is it possible to make an HTTP request that gets a response, and transfert this response on another server for example ?
 
Why is the word "abbreviation" so long? And this ad is so short?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic