java - 如何将多个json网址的内容添加到单个json对象中

标签 java arrays json database gradle

我正在编写一个使用电影数据库(TMDB)“themoviedb.org”输出的JSON样式的应用程序。每页有20个结果,而我当前的设置允许第一页的结果。 url=("https://api.themoviedb.org/3/search/tv?api_key=" + API_KEY + "&language=en-US&page=1&query=" + Query + "&include_adult=false");如果查询返回的结果大于20,则将添加页面以适合所有数据。注意URL的page=1部分。如果有20个以上的结果,则为了获得其他结果,page将等于随后的页码。以下是示例URL输出:

{"page":1,"total_results":171,"total_pages":9,"results":[{"original_name":"Samurai Jack","id":2723,"name":"Samurai Jack","popularity":24.154,"vote_count":313,"vote_average":8.3,"first_air_date":"2001-08-10","poster_path":"\/xcIQe61dObuBsexWXgAkZAwhenq.jpg","genre_ids":[10759,16,10765],"original_language":"en","backdrop_path":"\/kgTxdNktcvIIGZus6ALFyeW8ruY.jpg","overview":"A great warrior is displaced to the distant future by the evil shape-shifting wizard Aku. The world has become a bleak place under the rule of Aku, segregated into fantastic tribes and ruled by Aku's evil robot warlords. Jack travels this foreign landscape in search of a time portal that can return him to his home time so he can \"undo the future that is Aku!\".","origin_country":["US"]},{"original_name":"Tom Clancy's  Jack Ryan","genre_ids":[18,10759,10768],"name":"Tom Clancy's  Jack Ryan","popularity":33.559,"origin_country":["US"],"vote_count":477,"first_air_date":"2018-08-30","backdrop_path":"\/6ovk8nrrSmN1ieT14zBAxcHbMU7.jpg","original_language":"en","id":73375,"vote_average":7.7,"overview":"When CIA analyst Jack Ryan stumbles upon a suspicious series of bank transfers his search for answers pulls him from the safety of his desk job and catapults him into a deadly game of cat and mouse throughout Europe and the Middle East, with a rising terrorist figurehead preparing for a massive attack against the US and her allies.","poster_path":"\/1raUrQr8Y2tSYjTDbk8wfWGKTmX.jpg"},{"original_name":"Gentleman Jack","genre_ids":[18],"name":"Gentleman Jack","popularity":15.285,"origin_country":["US"],"vote_count":39,"first_air_date":"2019-04-22","backdrop_path":"\/s9DGCAUeLc8Tiih571TZiCffn0U.jpg","original_language":"en","id":86163,"vote_average":7.8,"overview":"Halifax, West Yorkshire, England, 1832. Anne Lister attempts to revitalize her inherited home, Shibden Hall. Most notably for the time period, a part of her plan is to help the fate of her own family - by taking a wife.","poster_path":"\/7P0YsVuSuAIZBKhkx9jB1kTyoOl.jpg"},{"original_name":"Jack the Ripper","genre_ids":[80,18,9648],"name":"Jack the Ripper","popularity":7.64,"origin_country":["GB"],"vote_count":47,"first_air_date":"1988-10-11","backdrop_path":"\/te4aXaQMlI3meqN9DKsxfi7koQz.jpg","original_language":"en","id":47510,"vote_average":7.3,"overview":"Jack the Ripper is a 1988 two-part television film\/miniseries portraying a fictionalized account of the hunt for Jack the Ripper, the unidentified serial killer responsible for the Whitechapel murders of 1888. The series coincided with the 100th anniversary of the murders.","poster_path":"\/ym7QZhPaMQYmuxCxe5a25oCg4wQ.jpg"},{"original_name":"Jack & Jill","genre_ids":[35,18],"name":"Jack & Jill","popularity":4.923,"origin_country":["US"],"vote_count":10,"first_air_date":"1999-09-26","backdrop_path":"\/3kaQdZuSHyD6hmUEcDmaHi0EXLU.jpg","original_language":"en","id":1085,"vote_average":7.3,"overview":"A lighthearted romantic comedy about post-collegiate life, love and career in New York City.","poster_path":"\/dyBkpqH6oPAF5CAegq2fPW1AuAx.jpg"},{"original_name":"Surviving Jack","genre_ids":[35],"name":"Surviving Jack","popularity":5.03,"origin_country":["US"],"vote_count":30,"first_air_date":"2014-03-27","backdrop_path":"\/i9NJXVdnbIAgpriepeImGUeNhUy.jpg","original_language":"en","id":60772,"vote_average":7.3,"overview":"A boy becomes a man, and a man becomes a father, in a time before coming of age was something you could Google.","poster_path":"\/mDbKt7W6wQRg59dpGJUY8r9HNx2.jpg"},{"original_name":"Jack Taylor","genre_ids":[18],"name":"Jack Taylor","popularity":4.78,"origin_country":["IE"],"vote_count":8,"first_air_date":"2010-08-02","backdrop_path":"\/y7n9IrZ0QoTyxbFgBasNLalnOsF.jpg","original_language":"en","id":46705,"vote_average":6.6,"overview":"Jack Taylor is an Irish television drama based on a series of novels by Ken Bruen. Set in Galway, the series stars Iain Glen in the eponymous role of Jack Taylor, a former officer with the Garda Síochána who becomes a \"finder\" after leaving the service. Taylor is a man who goes looking for clues where others have not bothered to. He also knows the streets of his hometown like the back of his hand.\n\nThe series was first broadcast on TV3 in Ireland on 2 August 2010, and subsequently aired on Canvas in Belgium with Dutch subtitles. It received its UK debut on Channel 5 on 21 February 2013. The series has also been made available on DVD. It has received mixed reviews from critics. Bernice Harrison of The Irish Times felt the series was spoiled by Glen's voiceovers, which gave the character the feel of a gumshoe in a film noir. But David Stephenson of the Daily Express said he had been hooked by the first episode's strong opening sequence. A real-life private investigator interviewed by The Guardian's Laura Barnett said that he found the series entertaining, but that it did not always give an accurate portrayal of his profession.","poster_path":"\/aEZJsUZProvHa5FykCUt4nJxVEN.jpg"},{"original_name":"Jack of All Trades","id":4162,"name":"Jack of All Trades","popularity":7.51,"vote_count":16,"vote_average":8,"first_air_date":"2000-01-17","poster_path":"\/xb3mRdxS75EN32l1RqrFMFcZBUr.jpg","genre_ids":[10759,35],"original_language":"en","backdrop_path":null,"overview":"Jack of All Trades is a half-hour long syndicated action-comedy television series which ran for two seasons in 2000. With Cleopatra 2525, it formed the Back2Back Action Hour and both shows were notable for being the first American non-animated action series to be produced in the half-hour format since the 1970s. The show was canceled in the middle of its second season.\n\nThe program is set at the turn of the 19th century on the fictional French-controlled island of Pulau-Pulau in the East Indies. Jack Stiles is an American secret agent sent there by President Jefferson. While there, he meets his British contact and love interest, English spy Emilia Rothschild. Together, the two work to stop Napoleon and various other threats to the United States. To the public, Jack is seen as Emilia's attaché, but when the need arises, he transforms into a masked hero: The Daring Dragoon.\n\nThe show contained many on-going gags, such as deliberate historical inaccuracies, Jack being responsible for many important historical events but not receiving credit, Emilia inventing a miraculous invention in an obvious deus ex machina, sexual puns and innuendos, and Jack and Emilia's ongoing romantic tension.","origin_country":["US"]},{"original_name":"Jack Irish","id":58057,"name":"Jack Irish","popularity":4.223,"vote_count":9,"vote_average":6.9,"first_air_date":"2016-02-11","poster_path":"\/9f66kq0vLHztRL44FcGCqyaqUJo.jpg","genre_ids":[18,80],"original_language":"en","backdrop_path":"\/yxHPyiOGOcc3k2WGGAzrHnrq5kw.jpg","overview":"Jack Irish is a man getting his life back together again. A former criminal lawyer whose world imploded, he now spends his days as a part-time investigator, debt collector, apprentice cabinet maker, punter and sometime lover – the complete man really. An expert in finding those who don’t want to be found – dead or alive, Jack helps out his mates while avoiding the past. That is until the past finds him.","origin_country":["AU"]},{"original_name":"Jack & Bobby","id":1859,"name":"Jack & Bobby","popularity":3.396,"vote_count":3,"vote_average":8.3,"first_air_date":"2004-09-12","poster_path":null,"genre_ids":[18],"original_language":"en","backdrop_path":null,"overview":"If \"greatness is thrust upon us,\" as Winston Churchill once said, then it stands to reason that those who are destined for greatness are rarely aware of it. Take Jack and Bobby McCallister for example: two bright young brothers growing up under the watchful eye of their eccentric single mother Grace McCallister. Grace's personality is a force of nature destined to shape both of these young men's lives and secure one a place in the history books - as President of the United States.","origin_country":["US"]},{"original_name":"Mad Jack the Pirate","id":16953,"name":"Mad Jack the Pirate","popularity":4.867,"vote_count":8,"vote_average":7.3,"first_air_date":"1998-09-12","poster_path":"\/4Wr4COdl9vsVpIka5zjijaLjRZk.jpg","genre_ids":[16,35,10751],"original_language":"en","backdrop_path":"\/jLnCDBZfBUfuFByGI14SlBBn0pA.jpg","overview":"Mad Jack the Pirate is a short lived 1990s cartoon. The show was created by Bill Kopp and was directed by Jeff DeGrandis. On American television, the show was broadcast on Fox Kids.\n\nThe concept is of the adventures of the rather unsuccessful and cowardly Pirate Jack who despite his failures never doubts his own excellence and his dim-witted anthropomorphic rat sidekick Snuk as they sail the seas on their ship the Sea Chicken.\n\nOften noticed by fans and viewers of the show is its similarity to the BBC comedy series Blackadder. Similarities of the main characters: Jack to Edmund Blackadder and Snuk to Baldrick and even almost identical quotes from the series. Even Jack's archenemy Flash is not unlike Lord Flashheart and Angus is similar to McAngus. Currently, in some countries, the cartoon has DVD & VCD Editions. Also in Turkey, the cartoon was shown on Jetix Play and in Poland on Fox Kids.\n\nOn July 23, 2001, Mad Jack and other properties of Saban Entertainment were sold to The Walt Disney Company.","origin_country":["US"]},{"original_name":"Zoe, Duncan, Jack and Jane","genre_ids":[35],"name":"Zoe, Duncan, Jack and Jane","popularity":3.936,"origin_country":["US"],"vote_count":1,"first_air_date":"1999-01-17","backdrop_path":null,"original_language":"en","id":5183,"vote_average":6,"overview":"Zoe, Duncan, Jack and Jane is an American teen sitcom starring Selma Blair, David Moscow, Michael Rosenbaum, and Azura Skye that premiered in 1999 on The WB network. During development, the show was initially known as Zoe Bean and was later retitled Zoe... during its second season.\n\nThe series ran for a total of 26 episodes.","poster_path":"\/jvh4tMxZVSBq9NeiIaG0hApLOpZ.jpg"},{"original_name":"The Jack Benny Program","id":10151,"name":"The Jack Benny Program","popularity":3.703,"vote_count":7,"vote_average":8.4,"first_air_date":"1950-10-28","poster_path":"\/iwXBIb8zWPpt916UoOiYBPigbEI.jpg","genre_ids":[35],"original_language":"en","backdrop_path":null,"overview":"A television program starring Jack Benny.","origin_country":["US"]},{"original_name":"Jack and Mike","id":26532,"name":"Jack and Mike","popularity":1.96,"vote_count":0,"vote_average":0,"first_air_date":"1986-09-23","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["US"]},{"original_name":"Jack and the Beanstalk: The Real Story","genre_ids":[18,10759,10765],"name":"Jack and the Beanstalk: The Real Story","popularity":4.454,"origin_country":["US"],"vote_count":41,"first_air_date":"2001-12-02","backdrop_path":"\/3JoUYX3JRXvmGlWTpWCzyhmoxTZ.jpg","original_language":"en","id":16433,"vote_average":6.4,"overview":"Jack and the Beanstalk: The Real Story is a 2001 American television miniseries. It was directed by Brian Henson and was a co-production of CBS and Jim Henson Television. It is an alternative version of the classic English fairy tale Jack and the Beanstalk. The story was considerably reworked to reflect what Henson believed to be a more ethical, humanist view. The cast includes Matthew Modine, Mia Sara, Jon Voight, and Vanessa Redgrave. Richard Attenborough, Daryl Hannah, and a young James Corden play giants. Among the other giants in the film are beings from the mythology of various cultures, including Hebrew, Buddhist, and Nordic.","poster_path":"\/mc6QDvw7hExEILHJ1zCjZ3MkUya.jpg"},{"original_name":"Jack Whitehall: Travels with My Father","genre_ids":[35,10764],"name":"Jack Whitehall: Travels with My Father","popularity":5.392,"origin_country":["GB"],"vote_count":13,"first_air_date":"2017-09-22","backdrop_path":"\/4fprfaN6IYGevyvwuAZpCk3Fekk.jpg","original_language":"en","id":74100,"vote_average":6.9,"overview":"Comic Jack Whitehall invites his stodgy, unadventurous father to travel with him to odd locations and events in an attempt to strengthen their bond.","poster_path":"\/4YmLWIECW3OE7NiP9uwUK35i2uH.jpg"},{"original_name":"Goldie Gold and Action Jack","id":30255,"name":"Goldie Gold and Action Jack","popularity":3.128,"vote_count":0,"vote_average":0,"first_air_date":"1981-09-12","poster_path":null,"genre_ids":[16],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["US"]},{"original_name":"Jack's Place","id":34178,"name":"Jack's Place","popularity":6.115,"vote_count":1,"vote_average":10,"first_air_date":"1992-05-26","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"Jack's Place is an American drama series that aired from May 26, 1992 to July 13, 1993 on ABC. The series was about a retired jazz musician named Jack Evans who runs a restaurant where romances tend to start. The waitress, Chelsea, was played by Finola Hughes and the bartender Greg was played by John Dye.","origin_country":["US"]},{"original_name":"Jack Holborn","id":6902,"name":"Jack Holborn","popularity":1.273,"vote_count":5,"vote_average":8.2,"first_air_date":"1982-12-21","poster_path":"\/k6vm64qnczla0GVRq4tMpzffvoX.jpg","genre_ids":[10751,10759],"original_language":"de","backdrop_path":null,"overview":"Jack Holborn was a 1982 ZDF Adventure TV mini-series. The story is based on the book by Leon Garfield. It was shown in the United Kingdom by ITV.","origin_country":["DE"]},{"original_name":"Odd Job Jack","genre_ids":[16,35],"name":"Odd Job Jack","popularity":2.035,"origin_country":["CA"],"vote_count":0,"first_air_date":"2003-03-05","backdrop_path":null,"original_language":"en","id":2101,"vote_average":0,"overview":"Odd Job Jack was a Canadian animated comedy television show featuring Don McKellar, about one man's misadventures in temporary employment. Seen on and produced for the The Comedy Network, a cable specialty channel, and shown on Adult Swim in Latin America, the show has currently finished its production run as of its fourth season. The second season has been released to DVD, and seasons two through four can currently be seen on the on demand streaming video service Hulu.","poster_path":null}]}

{"page":2,"total_results":171,"total_pages":9,"results":[{"original_name":"Heat Vision and Jack","genre_ids":[35,18,10759],"name":"Heat Vision and Jack","popularity":1.4,"origin_country":["US"],"vote_count":0,"first_air_date":"","backdrop_path":null,"original_language":"en","id":5733,"vote_average":0,"overview":"Heat Vision and Jack is a proposed 1999 comedy\/sci-fi television short directed by Ben Stiller and starring Jack Black, Owen Wilson, and Ron Silver. Christine Taylor and Vincent Schiavelli guest starred in the pilot episode, the only episode filmed. While the Fox Network didn't pick up the show, the pilot gained a cult status and an online following. The show was written and executive produced by Dan Harmon and Rob Schrab The pair also worked together on Channel 101 and The Sarah Silverman Program.\n\nHeat Vision was featured as a part of the mockumentary \"Tropic Thunder - Rain of Madness\", only stating that the character of \"Jeff Portnoy\" played the role of Jack Austin. According to a March 27, 2007 interview with Rob Schrab, a script for the Heat Vision and Jack feature film is in the works.","poster_path":null},{"original_name":"Jack of Hearts","id":26829,"name":"Jack of Hearts","popularity":1.477,"vote_count":0,"vote_average":0,"first_air_date":"1999-08-04","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["GB"]},{"original_name":"Jack","id":46708,"name":"Jack","popularity":0.6,"origin_country":[],"original_language":"en","vote_count":0,"backdrop_path":null,"genre_ids":[16],"vote_average":0,"overview":"","poster_path":null},{"original_name":"Jack Arnold erzählt","id":90467,"name":"Jack Arnold erzählt","popularity":1.126,"vote_count":0,"vote_average":0,"first_air_date":"1983-10-27","poster_path":"\/kfCThxoQX9D93bLa3M822VZLKID.jpg","genre_ids":[99],"original_language":"de","backdrop_path":null,"overview":"","origin_country":[]},{"original_name":"You Don't Know Jack","genre_ids":[],"name":"You Don't Know Jack","popularity":1.176,"origin_country":["US"],"vote_count":1,"first_air_date":"2001-06-20","backdrop_path":null,"original_language":"en","id":15044,"vote_average":9,"overview":"You Don't Know Jack was a short-lived game show based on the bestselling computer game series of the same name that aired on ABC in the summer of 2001. Paul Reubens, best known for his role as Pee-wee Herman on Pee-wee's Playhouse, played host Troy Stevens. Tom Gottlieb reprised his role as Cookie Masterson, who was the announcer. The show lasted only six episodes, and was replaced by The Wayne Brady Show.","poster_path":null},{"original_name":"The Jack and Triumph Show","genre_ids":[35],"name":"The Jack and Triumph Show","popularity":1.776,"origin_country":["US"],"vote_count":5,"first_air_date":"2015-02-20","backdrop_path":null,"original_language":"en","id":62077,"vote_average":5.4,"overview":"The series will feature Jack McBrayer playing a version of himself who was the child star of a Lassie-like series and Triumph, the dog who went into the world of decadence and took Jack with him. 15 years later, Jack managed to put his life together until Triumph came back into his life. The live-action series will be created by Robert S. Smigel, Michael Koman and David Feldman.","poster_path":null},{"original_name":"My Brother Jack","id":29533,"name":"My Brother Jack","popularity":1.377,"vote_count":0,"vote_average":0,"first_air_date":"1965-08-21","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"Ed Devereaux stars as Jack in the 1965 television serial adaption of George Johnston's 1964 book My Brother Jack, adapted for ABC television by Charmian Clift. This semi-autobiographical novel follows the narrator, David Meredith, through his childhood and adolescence in interwar Melbourne (1920's and 1930's) through to adulthood and his journalism career during World War II. The novel constantly contrasts him with his older and more \"typically Australian,\" brother, Jack.","origin_country":["AU"]},{"original_name":"Jack Dee's Full Mountie","id":28021,"name":"Jack Dee's Full Mountie","popularity":1.4,"vote_count":0,"vote_average":0,"first_air_date":"2000-02-03","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["GB"]},{"original_name":"Jack In A Box","id":46662,"name":"Jack in a Box","popularity":0.84,"vote_count":0,"vote_average":0,"first_air_date":"2009-07-07","poster_path":"\/9HUMD3r0BRW7Feo8xULCUVLVApX.jpg","genre_ids":[35],"original_language":"en","backdrop_path":"\/oz3fac6wl3v6TInjjO7lvQZGZYe.jpg","overview":"Jack was a mild-mannered young man with a BFA in acting and no life skills. He took a job at a theater box office because it didn't involve heavy lifting, wearing a blazer or using Excel. A few years and thousands of customers later, Jack finds himself less mild-mannered and less young than ever before. Watch Jack try to manage his anger while navigating an insular universe where everyone is even more unstable than he is. Like all caged animals, he is going to throw his sh*t at you sooner or later... but first he's going to eat a cupcake and take a phone call from his mom. Service with a smirk, that's all you can ask for.","origin_country":["US"]},{"original_name":"Jack Of Diamonds","id":24887,"name":"Jack Of Diamonds","popularity":1.09,"vote_count":0,"vote_average":0,"first_air_date":"1983-06-03","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["GB"]},{"original_name":"Iedereen is gek op Jack","id":38319,"name":"Iedereen is gek op Jack","popularity":1.975,"vote_count":0,"vote_average":0,"first_air_date":"2011-02-21","poster_path":"\/6mBoorVY4G83PXYPd8OpfstR0Eu.jpg","genre_ids":[35],"original_language":"nl","backdrop_path":null,"overview":"","origin_country":["NL"]},{"original_name":"Jack and Knaves","id":38284,"name":"Jack and Knaves","popularity":0.6,"origin_country":["GB"],"original_language":"en","vote_count":0,"backdrop_path":null,"genre_ids":[],"vote_average":0,"overview":"","poster_path":null},{"original_name":"Jack Osbourne: Adrenaline Junkie","genre_ids":[],"name":"Jack Osbourne: Adrenaline Junkie","popularity":1.512,"origin_country":["GB"],"vote_count":0,"first_air_date":"2005-10-01","backdrop_path":null,"original_language":"en","id":2446,"vote_average":0,"overview":"Jack Osbourne: Adrenaline Junkie was a British reality television series on ITV2, series 1 focused on Jack Osbourne's globe-trekking six-month quest to get in physical and mental shape to climb the rockface of California's El Capitan mountain, the show documents Osbourne running with the bulls in Pamplona, Spain, following a strict exercise regimen, Muay Thai training in Thailand, and \"an overall 180-degree mental make-over\".\n\nThe show was broadcast by MuchMusic in Canada, and the Travel Channel in the United States, and Series 1 and 2 were repeated on the ITV Network late at night. The programme is also broadcast on the Extreme Sports Channel in the UK.","poster_path":"\/44HIGmZUu4R89mZfD8wxnbQWfLS.jpg"},{"original_name":"Bringing up Jack","id":25787,"name":"Bringing up Jack","popularity":0.993,"vote_count":0,"vote_average":0,"first_air_date":"1995-05-27","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"Bringing up Jack is an American sitcom television series that aired from May 27 until June 24, 1995.","origin_country":["US"]},{"original_name":"Uncle Jack","id":5321,"name":"Uncle Jack","popularity":0.6,"vote_count":0,"vote_average":0,"first_air_date":"1990-10-04","poster_path":null,"genre_ids":[18,35],"original_language":"en","backdrop_path":null,"overview":"Uncle Jack was a children's TV show which aired on BBC1 in the early 1990s. The show's hero, Jack Green, and his family are on a mission to save the planet. Jack Green's arch nemesis was a woman who was only known as The Vixen who would be planning on overtaking the world.\n\nUncle Jack ran for four series; each had an environmental message:\n\n⁕Uncle Jack and Operation Green\n\n⁕Uncle Jack and the Loch Noch Monster\n\n⁕Uncle Jack and the Dark Side of the Moon\n\n⁕Uncle Jack and Cleopatra's Mummy","origin_country":["GB"]},{"original_name":"Union Jack","id":30458,"name":"Union Jack","popularity":0.6,"vote_count":0,"vote_average":0,"first_air_date":"2003-11-10","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["GB"]},{"original_name":"Buhawi Jack","genre_ids":[],"name":"Buhawi Jack","popularity":0.6,"origin_country":["PH"],"vote_count":1,"first_air_date":"","backdrop_path":null,"original_language":"en","id":37728,"vote_average":10,"overview":"Wansapanataym Presents: Buhawi Jack is the first fantaserye offering in the Wansapanataym series aired on ABS-CBN. This series is based on the comic strip Buhawi Jack by Rod Santiago.","poster_path":null},{"original_name":"Jack London","genre_ids":[],"name":"Jack London","popularity":0.6,"origin_country":[],"vote_count":0,"first_air_date":"2017-01-01","backdrop_path":"\/jt3lme9N83ruo9E0f4F4LlD3uTu.jpg","original_language":"en","id":78015,"vote_average":0,"overview":"An in-depth biography of the famous American writer, Jack London, who came of age at the time of America's emergence onto the world stage.","poster_path":null},{"original_name":"Jack Johnson","id":47496,"name":"Jack Johnson","popularity":0.6,"vote_count":0,"vote_average":0,"first_air_date":"","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"","origin_country":["US"]},{"original_name":"Outback Jack","id":10973,"name":"Outback Jack","popularity":0.6,"vote_count":0,"vote_average":0,"first_air_date":"","poster_path":null,"genre_ids":[],"original_language":"en","backdrop_path":null,"overview":"Outback Jack was a 2004 reality TV show filmed in Outback, Australia. It was produced by Nash Entertainment. It starred Vadim Dale, a 6-foot-tall former underwear model, as Outback Jack, and started with twelve women who vied for Vadim's attentions to be selected as the woman he would choose to be with. The show first aired on the TBS network and was hosted by JD Roberto.\n\nOutback Jack's first episode featured the twelve contestants getting out of limousines and lining up outside a mansion in the U.S., thinking they were about to be a part of a show similar to The Bachelor, only to be told by the host that \"their man\" was waiting for them in Australia. The dozen were shocked again, upon arriving in Australia, to find out that they would be competing in the Outback and that they would have to parachute out of planes to get to their destination.\n\nVadim has since relocated to Louisville, Kentucky to be with Natalie Franzman, his co-star and the winning contestant on Outback Jack. The two were married on October 22, 2005 and also featured on Celebrity Circus, which was shown on Australia's Nine Network. Vadim, now an officer with the Louisville Metro Police Department, and Natalie have three daughters—Hunter, Eden and Chloe. Dale was also a CLEO magazine centrefold. Former WWE Diva Maria Kanellis and Cortney Owen, the current wife of NASCAR driver Johnny Sauter were contestants on the show.","origin_country":["US"]}]}
我想做的是将所有页面的总结果合并为一个正文,以作为一个JSONObject处理。
这就是我用来获取第一页的内容,当我尝试使用for循环来更改URL字符串的页码时,会收到错误消息。
private JSONObject url2json(String url) throws IOException, ParseException { //method is used to take JSON urls and put the url contents into JSONObject
    URL JSONURL = new URL(url);
    HttpURLConnection con = (HttpURLConnection) JSONURL.openConnection();
    con.setDoOutput(true);
    con.setRequestMethod("GET");
    con.setRequestProperty("Content-Type", "application/json");
    BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream())));
    Object obj = new JSONParser().parse(br.readLine());
    return (JSONObject) obj;
}
这是我使用的JSON库:compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'以下是API的文档:https://developers.themoviedb.org/3/search/search-tv-shows
我已经尝试过自己寻找解决方案,但到目前为止却没有成功,因此,为什么在这里,我能提供任何帮助。

最佳答案

创建一个模型类并尝试通过这种方式进行分配

JsonParser rawParser = new JsonParser();
Gson gson = new Gson();

BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream())));
JsonObject object = (JsonObject) rawParser.parse(br.readLine());
Model model= gson.fromJson(object, Model.class); 

关于java - 如何将多个json网址的内容添加到单个json对象中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64586763/

相关文章:

java - 如何将正确的文本设置为 textView(我在 textView 的方向设置了 RTL)

java - token "<="上的语法错误,无效的 AssignmentOperator

java - 客户端-服务器数据同步策略[Java]

javascript - lodash 字段的唯一计数

c++ - 在 c 中的二维数组的末尾添加一个额外的数据列

python - 无法保留内存块,在 python 中导入 json 错误

java - 如何在解释的情况下使用java中的泛型类型声明?

php - 在多维 session 数组中插入和回显元素

java - C# 和 Java 服务器之间的 TCP 通信

javascript - 在 Javascript 中将变量传递到 JSON 值请求